[jedit] 01/06: Imported Upstream version 5.1.0+dfsg

Tony Mancill tmancill at alioth.debian.org
Mon Oct 21 04:40:01 UTC 2013


This is an automated email from the git hooks/post-receive script.

tmancill pushed a commit to branch master
in repository jedit.

commit 6c3d6187009668aa4fb06465705eaf5f31e79dd4
Author: tony mancill <tmancill at debian.org>
Date:   Sun Oct 20 16:19:33 2013 -0700

    Imported Upstream version 5.1.0+dfsg
---
 README.SRC.txt                                     |   27 +-
 build.xml                                          |   30 +-
 doc/CHANGES.txt                                    |  508 ++--
 doc/FAQ/faq-macros.xml                             |    4 +-
 doc/FAQ/faq-plugins.xml                            |   40 +-
 doc/FAQ/faq-use.xml                                |  141 +-
 doc/FAQ/faq.xml                                    |    6 +-
 doc/releasing-jedit.txt                            |   15 +-
 doc/tips/tip1.html                                 |    3 +-
 doc/tips/tip14.html                                |    3 +-
 doc/tips/tip16.html                                |   10 +-
 doc/tips/tip2.html                                 |    6 +-
 doc/tips/tip22.html                                |   10 +-
 doc/tips/tip26.html                                |    7 +-
 doc/tips/tip3.html                                 |    2 +-
 doc/tips/tip32.html                                |    6 +-
 doc/tips/tip34.html                                |    7 +-
 doc/tips/tip43.html                                |    3 +-
 doc/tips/tip66.html                                |    3 +-
 doc/tips/tip81.html                                |    9 +-
 doc/tips/tip88.html                                |    9 +-
 doc/users-guide/activity-log.xml                   |   12 +-
 doc/users-guide/basics.xml                         |    4 +-
 doc/users-guide/customizing.xml                    |   17 +-
 doc/users-guide/files.xml                          |   26 +-
 doc/users-guide/macro-basics.xml                   |    5 -
 doc/users-guide/macro-index.xml                    |   14 +-
 doc/users-guide/source-edit.xml                    |   10 +-
 doc/users-guide/text-edit.xml                      |   14 +
 doc/users-guide/users-guide.xml                    |    6 +-
 doc/users-guide/writing-modes.xml                  |   86 +-
 doc/welcome.html                                   |    2 +-
 doc/whatsnew/news.xml                              |   53 +-
 installer/OperatingSystem.java                     |   12 +-
 installer/ServerKiller.java                        |    2 +-
 installer/done-HalfAnOS.html                       |    8 +
 installer/install.props                            |    8 +-
 ivy.xml                                            |    3 +-
 keymaps/Emacs_keys.props                           |   85 +-
 keymaps/Mac_OS_X_keys.props                        |   25 +-
 macros/C/Toggle_Header_Source.bsh                  |   28 +-
 macros/Clipboard/Copy_Lines.bsh                    |   13 +-
 macros/Clipboard/Cut_Lines.bsh                     |    4 +-
 macros/Editing/Move_Lines_Down.bsh                 |  110 +-
 macros/Editing/Move_Lines_Up.bsh                   |  129 +-
 macros/Emacs/EmacsUtil.bsh                         |  301 +++
 macros/Emacs/Emacs_Align_Decls.bsh                 |   34 +
 macros/Emacs/Emacs_Backward_Sentence.bsh           |   13 +
 macros/Emacs/Emacs_Capitalize_Word.bsh             |   37 +
 macros/Emacs/Emacs_Center_Line.bsh                 |   66 +
 macros/{Editing => Emacs}/Emacs_Ctrl-K.bsh         |    0
 macros/Emacs/Emacs_Downcase_Word.bsh               |   23 +
 macros/Emacs/Emacs_Exchange_Point_and_Mark.bsh     |   21 +
 macros/Emacs/Emacs_Fixup_Whitespace.bsh            |   92 +
 macros/Emacs/Emacs_Forward_Sentence.bsh            |   13 +
 macros/Emacs/Emacs_Insert_File.bsh                 |   21 +
 macros/Emacs/Emacs_Kill_Line.bsh                   |   75 +
 macros/Emacs/Emacs_Kill_Region.bsh                 |   27 +
 macros/Emacs/Emacs_Kill_Ring_Save.bsh              |   22 +
 macros/Emacs/Emacs_Kill_Sentence.bsh               |   20 +
 macros/{Editing => Emacs}/Emacs_Next_Line.bsh      |    2 +-
 macros/Emacs/Emacs_Open_Line.bsh                   |   18 +
 macros/{Editing => Emacs}/Emacs_Previous_Line.bsh  |    2 +-
 macros/Emacs/Emacs_Set_Mark.bsh                    |   15 +
 macros/Emacs/Emacs_Set_Wrap.bsh                    |   57 +
 macros/Emacs/Emacs_Transpose_Chars.bsh             |   27 +
 macros/Emacs/Emacs_Transpose_Lines.bsh             |   45 +
 macros/Emacs/Emacs_Upcase_Word.bsh                 |   23 +
 macros/Emacs/LICENSE.md                            |   36 +
 macros/Emacs/README.md                             |   27 +
 macros/Files/Close_All_Except_Active.bsh           |   57 -
 macros/Files/Glob_Close.bsh                        |    2 +-
 macros/Files/Insert_Selection.bsh                  |    8 +-
 macros/Files/Open_Selection.bsh                    |  139 +-
 macros/Files/Open_Selection_In_Desktop.bsh         |  106 +
 macros/Java/Get_Class_Name.bsh                     |    2 +-
 macros/Misc/Display_Abbreviations.bsh              |    2 +-
 macros/Misc/Generate Encodings List.bsh            |   32 +
 macros/Misc/Generate Modes List.bsh                |   27 +
 macros/Misc/Insert Plugins List.bsh                |   21 +
 macros/Misc/Make_Bug_Report.bsh                    |    3 +-
 macros/Misc/Run_Script.bsh                         |    5 +-
 macros/Properties/Insert_Buffer_Properties.bsh     |    4 +-
 macros/Properties/Look_and_Feel_Properties.bsh     |    3 +-
 macros/Properties/System_Properties.bsh            |    5 +-
 macros/Properties/jEdit_Properties.bsh             |    3 +-
 misc/mode_lint/mode_lint.xsl                       |  106 +
 modes/ant.xml                                      |    6 +-
 modes/bcel.xml                                     |    2 +-
 modes/catalog                                      |   20 +-
 modes/cfscript.xml                                 |  679 ++++++
 modes/clips.xml                                    |    2 +-
 modes/coffeescript.xml                             |   50 +-
 modes/coldfusion.xml                               |  852 +++----
 modes/css.xml                                      |   29 +-
 modes/html.xml                                     |  164 +-
 modes/jamon.xml                                    |  123 +
 modes/lua.xml                                      |   20 +-
 modes/mail.xml                                     |    6 -
 modes/maven.xml                                    |  735 +++---
 modes/nsis2.xml                                    |   12 +-
 modes/objective-c.xml                              |    2 +-
 modes/objectrexx.xml                               |    2 +-
 modes/perl.xml                                     |   22 -
 modes/pg-sql.xml                                   | 1192 +++++++++
 modes/powerdynamo.xml                              |   16 +-
 modes/rfc.xml                                      |    1 +
 modes/ruby.xml                                     |   20 +-
 modes/rview.xml                                    |    2 +-
 modes/shellscript.xml                              |   20 +-
 modes/tld.xml                                      |  513 ++--
 modes/tthtml.xml                                   |    5 +-
 modes/url.xml                                      |    4 +-
 modes/vala.xml                                     |    9 +-
 modes/verilog.xml                                  |    3 +-
 modes/xml.xml                                      |   11 +-
 modes/yaml.xml                                     |    4 +-
 org/gjt/sp/jedit/Abbrevs.java                      |    4 +-
 org/gjt/sp/jedit/AbstractOptionPane.java           |    4 +-
 org/gjt/sp/jedit/ActionContext.java                |    4 +-
 org/gjt/sp/jedit/ActionListHandler.java            |    2 +-
 org/gjt/sp/jedit/ActionSet.java                    |    4 +-
 org/gjt/sp/jedit/Autosave.java                     |    4 +-
 org/gjt/sp/jedit/BeanShell.java                    |   33 +-
 org/gjt/sp/jedit/BeanShellAction.java              |    6 +-
 org/gjt/sp/jedit/BeanShellFacade.java              |    4 +-
 org/gjt/sp/jedit/Buffer.java                       |   53 +-
 org/gjt/sp/jedit/BufferHistory.java                |    9 +-
 org/gjt/sp/jedit/Debug.java                        |    4 +-
 org/gjt/sp/jedit/EBMessage.java                    |    4 +-
 org/gjt/sp/jedit/EditAction.java                   |    4 +-
 org/gjt/sp/jedit/EditBus.java                      |    4 +-
 org/gjt/sp/jedit/EditPane.java                     |   21 +-
 org/gjt/sp/jedit/EditPlugin.java                   |   10 +-
 org/gjt/sp/jedit/EditServer.java                   |   11 +-
 org/gjt/sp/jedit/GUIUtilities.java                 |   38 +-
 org/gjt/sp/jedit/IPropertyManager.java             |    2 +-
 org/gjt/sp/jedit/JARClassLoader.java               |    4 +-
 org/gjt/sp/jedit/JEditAbstractEditAction.java      |    2 +-
 org/gjt/sp/jedit/JEditActionContext.java           |    2 +-
 org/gjt/sp/jedit/JEditActionSet.java               |   15 +-
 org/gjt/sp/jedit/JEditBeanShellAction.java         |    2 +-
 org/gjt/sp/jedit/JEditKillRing.java                |    5 +-
 org/gjt/sp/jedit/JEditMode.java                    |    7 +-
 org/gjt/sp/jedit/JEditRegisterSaver.java           |    6 +-
 org/gjt/sp/jedit/JEditRegistersListener.java       |    2 +-
 org/gjt/sp/jedit/Macros.java                       |    4 +-
 org/gjt/sp/jedit/Marker.java                       |    4 +-
 org/gjt/sp/jedit/MiscUtilities.java                |   60 +-
 org/gjt/sp/jedit/Mode.java                         |   87 +-
 org/gjt/sp/jedit/ModeCatalogHandler.java           |   16 +-
 org/gjt/sp/jedit/OperatingSystem.java              |   70 +-
 org/gjt/sp/jedit/OptionGroup.java                  |    4 +-
 org/gjt/sp/jedit/PerspectiveManager.java           |   17 +-
 org/gjt/sp/jedit/PluginJAR.java                    |   35 +-
 org/gjt/sp/jedit/PropertyManager.java              |   42 +-
 org/gjt/sp/jedit/RegisterSaver.java                |    2 +-
 org/gjt/sp/jedit/Registers.java                    |    4 +-
 org/gjt/sp/jedit/RegistersListener.java            |    2 +-
 org/gjt/sp/jedit/ServiceListHandler.java           |    4 +-
 org/gjt/sp/jedit/ServiceManager.java               |   17 +-
 org/gjt/sp/jedit/SettingsReloader.java             |    2 +-
 org/gjt/sp/jedit/SettingsXML.java                  |    2 +-
 org/gjt/sp/jedit/SplitConfigParser.java            |    2 +-
 org/gjt/sp/jedit/TextUtilities.java                |    4 +-
 org/gjt/sp/jedit/View.java                         |  159 +-
 org/gjt/sp/jedit/actions.xml                       |    9 +-
 org/gjt/sp/jedit/browser/AbstractBrowserTask.java  |    4 +-
 org/gjt/sp/jedit/browser/BrowserCommandsMenu.java  |   21 +-
 org/gjt/sp/jedit/browser/BrowserView.java          |   37 +-
 org/gjt/sp/jedit/browser/DeleteBrowserTask.java    |  200 +-
 org/gjt/sp/jedit/browser/FileCellRenderer.java     |    4 +-
 .../sp/jedit/browser/ListDirectoryBrowserTask.java |    4 +-
 org/gjt/sp/jedit/browser/MkDirBrowserTask.java     |  194 +-
 org/gjt/sp/jedit/browser/RenameBrowserTask.java    |  262 +-
 org/gjt/sp/jedit/browser/VFSBrowser.java           |   75 +-
 .../sp/jedit/browser/VFSDirectoryEntryTable.java   |    4 +-
 .../jedit/browser/VFSDirectoryEntryTableModel.java |    4 +-
 org/gjt/sp/jedit/browser/VFSFileChooserDialog.java |   90 +-
 org/gjt/sp/jedit/browser/VFSFileNameField.java     |   11 +-
 org/gjt/sp/jedit/buffer/BufferAdapter.java         |    4 +-
 org/gjt/sp/jedit/buffer/BufferListener.java        |    4 +-
 org/gjt/sp/jedit/buffer/BufferSegment.java         |    4 +-
 org/gjt/sp/jedit/buffer/BufferUndoListener.java    |    4 +-
 org/gjt/sp/jedit/buffer/ContentManager.java        |   85 +-
 .../jedit/buffer/DefaultFoldHandlerProvider.java   |    2 +-
 org/gjt/sp/jedit/buffer/DummyFoldHandler.java      |    5 +-
 org/gjt/sp/jedit/buffer/ExplicitFoldHandler.java   |    4 +-
 org/gjt/sp/jedit/buffer/FoldHandler.java           |    4 +-
 org/gjt/sp/jedit/buffer/FoldHandlerProvider.java   |    2 +-
 org/gjt/sp/jedit/buffer/IndentFoldHandler.java     |    4 +-
 org/gjt/sp/jedit/buffer/JEditBuffer.java           |   49 +-
 org/gjt/sp/jedit/buffer/KillRing.java              |  107 +-
 org/gjt/sp/jedit/buffer/LineManager.java           |    4 +-
 org/gjt/sp/jedit/buffer/PositionManager.java       |    4 +-
 org/gjt/sp/jedit/buffer/UndoManager.java           |  382 ++-
 .../sp/jedit/bufferio/BufferAutosaveRequest.java   |   80 +-
 org/gjt/sp/jedit/bufferio/BufferIORequest.java     |   21 +-
 org/gjt/sp/jedit/bufferio/BufferInsertRequest.java |   27 +-
 org/gjt/sp/jedit/bufferio/BufferLoadRequest.java   |   37 +-
 org/gjt/sp/jedit/bufferio/BufferSaveRequest.java   |   24 +-
 org/gjt/sp/jedit/bufferio/IoTask.java              |    7 +
 org/gjt/sp/jedit/bufferio/MarkersSaveRequest.java  |    4 +-
 org/gjt/sp/jedit/bufferset/BufferSet.java          |    2 +-
 org/gjt/sp/jedit/bufferset/BufferSetAdapter.java   |    2 +-
 org/gjt/sp/jedit/bufferset/BufferSetListener.java  |    2 +-
 org/gjt/sp/jedit/bufferset/BufferSetManager.java   |    2 +-
 org/gjt/sp/jedit/datatransfer/JEditDataFlavor.java |   70 +-
 org/gjt/sp/jedit/datatransfer/JEditRichText.java   |  116 +-
 .../sp/jedit/datatransfer/JEditTransferable.java   |  122 +-
 .../datatransfer/JEditTransferableService.java     |   72 +-
 .../datatransfer/ListVFSFileTransferable.java      |  198 +-
 .../RichJEditTextTransferableService.java          |   86 +-
 .../jedit/datatransfer/RichTextTransferable.java   |  124 +-
 .../datatransfer/StringTransferableService.java    |   86 +-
 org/gjt/sp/jedit/datatransfer/TransferHandler.java |  156 +-
 org/gjt/sp/jedit/default.abbrevs                   |   11 +-
 org/gjt/sp/jedit/gui/AbbrevEditor.java             |    2 +-
 org/gjt/sp/jedit/gui/AboutDialog.java              |    2 +-
 .../sp/jedit/gui/AbstractContextOptionPane.java    |    2 +-
 org/gjt/sp/jedit/gui/ActionBar.java                |    2 +-
 org/gjt/sp/jedit/gui/AnimatedIcon.java             |    2 +-
 org/gjt/sp/jedit/gui/BeanShellErrorDialog.java     |    4 +-
 org/gjt/sp/jedit/gui/BufferOptions.java            |    4 +-
 org/gjt/sp/jedit/gui/BufferSwitcher.java           |    5 +-
 org/gjt/sp/jedit/gui/CloseDialog.java              |    5 +-
 org/gjt/sp/jedit/gui/ColorWellButton.java          |    4 +-
 org/gjt/sp/jedit/gui/CompleteWord.java             |    2 +-
 org/gjt/sp/jedit/gui/CompletionPopup.java          |    2 +-
 org/gjt/sp/jedit/gui/ContextAddDialog.java         |    2 +-
 org/gjt/sp/jedit/gui/DefaultFocusComponent.java    |    4 +-
 org/gjt/sp/jedit/gui/DefaultInputHandler.java      |    4 +-
 org/gjt/sp/jedit/gui/DockableLayout.java           |    2 +-
 org/gjt/sp/jedit/gui/DockablePanel.java            |    4 +-
 org/gjt/sp/jedit/gui/DockableWindowFactory.java    |   29 +-
 org/gjt/sp/jedit/gui/DockableWindowManager.java    |   12 +-
 .../sp/jedit/gui/DockableWindowManagerImpl.java    | 2115 ++++++++--------
 .../jedit/gui/DockableWindowManagerProvider.java   |   52 +-
 org/gjt/sp/jedit/gui/DockingFrameworkProvider.java |   44 +-
 org/gjt/sp/jedit/gui/DockingLayoutManager.java     |  554 ++---
 .../sp/jedit/gui/DynamicContextMenuService.java    |   62 +-
 org/gjt/sp/jedit/gui/EditAbbrevDialog.java         |    2 +-
 org/gjt/sp/jedit/gui/EnhancedButton.java           |    2 +-
 org/gjt/sp/jedit/gui/ErrorListDialog.java          |    2 +-
 org/gjt/sp/jedit/gui/ExtendedGridLayout.java       |    2 +-
 .../jedit/gui/ExtendedGridLayoutConstraints.java   |    2 +-
 org/gjt/sp/jedit/gui/FilePropertiesDialog.java     |  724 +++---
 org/gjt/sp/jedit/gui/FilesChangedDialog.java       |    4 +-
 org/gjt/sp/jedit/gui/FilteredListModel.java        |    2 +-
 org/gjt/sp/jedit/gui/FilteredTableModel.java       |   13 +-
 org/gjt/sp/jedit/gui/FloatingWindowContainer.java  |    4 +-
 org/gjt/sp/jedit/gui/FontSelector.java             |    4 +-
 org/gjt/sp/jedit/gui/FontSelectorDialog.java       |    4 +-
 org/gjt/sp/jedit/gui/GrabKeyDialog.java            |    3 +-
 org/gjt/sp/jedit/gui/HistoryModel.java             |    4 +-
 org/gjt/sp/jedit/gui/HistoryModelSaver.java        |    2 +-
 org/gjt/sp/jedit/gui/HistoryText.java              |    4 +-
 org/gjt/sp/jedit/gui/HistoryTextArea.java          |    8 +-
 org/gjt/sp/jedit/gui/HistoryTextField.java         |    8 +-
 org/gjt/sp/jedit/gui/IOProgressMonitor.java        |  218 --
 org/gjt/sp/jedit/gui/InputHandler.java             |    4 +-
 org/gjt/sp/jedit/gui/JCheckBoxList.java            |    2 +-
 org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java   |    6 +-
 org/gjt/sp/jedit/gui/KeyEventTranslator.java       |    4 +-
 org/gjt/sp/jedit/gui/KeyEventWorkaround.java       |   11 +-
 org/gjt/sp/jedit/gui/LogViewer.java                |   17 +-
 org/gjt/sp/jedit/gui/MarkerViewer.java             |    2 +-
 org/gjt/sp/jedit/gui/MutableListModel.java         |    2 +-
 org/gjt/sp/jedit/gui/NumericTextField.java         |    2 +-
 org/gjt/sp/jedit/gui/OptionsDialog.java            |    4 +-
 org/gjt/sp/jedit/gui/PanelWindowContainer.java     |    4 +-
 org/gjt/sp/jedit/gui/PasteFromListDialog.java      |    2 +-
 org/gjt/sp/jedit/gui/PasteSpecialDialog.java       |  308 +--
 org/gjt/sp/jedit/gui/PingPongList.java             |  910 +++----
 org/gjt/sp/jedit/gui/RegisterViewer.java           |   18 +-
 org/gjt/sp/jedit/gui/RolloverButton.java           |    4 +-
 org/gjt/sp/jedit/gui/SelectLineRange.java          |    2 +-
 .../sp/jedit/gui/ShortcutPrefixActiveEvent.java    |    2 +-
 org/gjt/sp/jedit/gui/StatusBar.java                |   63 +-
 org/gjt/sp/jedit/gui/StyleEditor.java              |    2 +-
 org/gjt/sp/jedit/gui/TaskMonitor.java              |    3 +-
 org/gjt/sp/jedit/gui/TextAreaDialog.java           |    2 +-
 org/gjt/sp/jedit/gui/TipOfTheDay.java              |    2 +-
 org/gjt/sp/jedit/gui/ToolBarManager.java           |    2 +-
 org/gjt/sp/jedit/gui/VariableGridLayout.java       |    2 +-
 .../gui/statusbar/BufferSetWidgetFactory.java      |    2 +-
 .../sp/jedit/gui/statusbar/ClockWidgetFactory.java |    2 +-
 .../jedit/gui/statusbar/EncodingWidgetFactory.java |    2 +-
 .../jedit/gui/statusbar/ErrorsWidgetFactory.java   |   21 +-
 .../sp/jedit/gui/statusbar/FoldWidgetFactory.java  |    2 +-
 .../jedit/gui/statusbar/IndentWidgetFactory.java   |    2 +-
 .../gui/statusbar/LastModifiedWidgetFactory.java   |  310 +--
 .../jedit/gui/statusbar/LineSepWidgetFactory.java  |    2 +-
 .../sp/jedit/gui/statusbar/ModeWidgetFactory.java  |    2 +-
 .../gui/statusbar/MultiSelectWidgetFactory.java    |    2 +-
 .../gui/statusbar/OverwriteWidgetFactory.java      |    2 +-
 .../gui/statusbar/RectSelectWidgetFactory.java     |    2 +-
 .../statusbar/SelectionLengthWidgetFactory.java    |    2 +-
 .../jedit/gui/statusbar/StatusWidgetFactory.java   |    2 +-
 .../gui/statusbar/TaskMonitorWidgetFactory.java    |  291 ++-
 org/gjt/sp/jedit/gui/statusbar/ToolTipLabel.java   |    2 +-
 org/gjt/sp/jedit/gui/statusbar/Widget.java         |    2 +-
 .../sp/jedit/gui/statusbar/WrapWidgetFactory.java  |    2 +-
 org/gjt/sp/jedit/gui/tray/JEditSwingTrayIcon.java  |  392 +--
 org/gjt/sp/jedit/gui/tray/JEditTrayIcon.java       |   82 +-
 org/gjt/sp/jedit/gui/tray/JTrayIcon.java           |  270 +--
 org/gjt/sp/jedit/gui/tray/JTrayIconManager.java    |  222 +-
 org/gjt/sp/jedit/help/HelpHistoryModel.java        |    4 +-
 .../sp/jedit/help/HelpHistoryModelListener.java    |    4 +-
 org/gjt/sp/jedit/help/HelpIndex.java               |    2 +-
 org/gjt/sp/jedit/help/HelpSearchPanel.java         |    2 +-
 org/gjt/sp/jedit/help/HelpTOCPanel.java            |    2 +-
 org/gjt/sp/jedit/help/HelpViewer.java              |    4 +-
 org/gjt/sp/jedit/help/HistoryButton.java           |    4 +-
 org/gjt/sp/jedit/indent/BracketIndentRule.java     |    4 +-
 .../sp/jedit/indent/CloseBracketIndentRule.java    |    4 +-
 org/gjt/sp/jedit/indent/DeepIndentRule.java        |    4 +-
 org/gjt/sp/jedit/indent/IndentAction.java          |    4 +-
 org/gjt/sp/jedit/indent/IndentRule.java            |    4 +-
 org/gjt/sp/jedit/indent/IndentRuleFactory.java     |    2 +-
 org/gjt/sp/jedit/indent/OpenBracketIndentRule.java |    4 +-
 org/gjt/sp/jedit/indent/RegexpIndentRule.java      |    4 +-
 org/gjt/sp/jedit/indent/WhitespaceRule.java        |    4 +-
 org/gjt/sp/jedit/input/AbstractInputHandler.java   |   26 +-
 .../jedit/input/DefaultInputHandlerProvider.java   |    2 +-
 org/gjt/sp/jedit/input/InputHandlerProvider.java   |    2 +-
 org/gjt/sp/jedit/input/TextAreaInputHandler.java   |    2 +-
 org/gjt/sp/jedit/io/AutoDetection.java             |    2 +-
 org/gjt/sp/jedit/io/CharsetEncoding.java           |   20 +-
 org/gjt/sp/jedit/io/CopyFileWorker.java            |    9 +-
 org/gjt/sp/jedit/io/Encoding.java                  |   17 +-
 org/gjt/sp/jedit/io/EncodingDetector.java          |    2 +-
 org/gjt/sp/jedit/io/EncodingServer.java            |    2 +-
 org/gjt/sp/jedit/io/EncodingWithBOM.java           |   28 +-
 org/gjt/sp/jedit/io/FavoritesVFS.java              |    8 +-
 org/gjt/sp/jedit/io/FileRootsVFS.java              |    4 +-
 org/gjt/sp/jedit/io/FileVFS.java                   |   13 +-
 org/gjt/sp/jedit/io/LocalFileSaveTask.java         |   49 +-
 org/gjt/sp/jedit/io/RegexEncodingDetector.java     |    2 +-
 org/gjt/sp/jedit/io/UrlVFS.java                    |    4 +-
 org/gjt/sp/jedit/io/VFS.java                       |   96 +-
 org/gjt/sp/jedit/io/VFSFile.java                   |   16 +-
 org/gjt/sp/jedit/io/VFSManager.java                |   47 +-
 org/gjt/sp/jedit/io/XMLEncodingDetector.java       |    2 +-
 org/gjt/sp/jedit/jEdit.java                        |  229 +-
 org/gjt/sp/jedit/jedit.props                       |   16 +-
 org/gjt/sp/jedit/jedit_gui.props                   |    9 +-
 org/gjt/sp/jedit/menu/DirectoryProvider.java       |    4 +-
 org/gjt/sp/jedit/menu/DynamicMenuProvider.java     |    4 +-
 .../sp/jedit/menu/EnhancedCheckBoxMenuItem.java    |    2 +-
 org/gjt/sp/jedit/menu/EnhancedMenu.java            |    2 +-
 org/gjt/sp/jedit/menu/EnhancedMenuItem.java        |    2 +-
 org/gjt/sp/jedit/menu/FavoritesProvider.java       |    2 +-
 org/gjt/sp/jedit/menu/MacrosProvider.java          |    2 +-
 org/gjt/sp/jedit/menu/MarkersProvider.java         |    2 +-
 org/gjt/sp/jedit/menu/MenuItemTextComparator.java  |  130 +-
 org/gjt/sp/jedit/menu/PluginsProvider.java         |    2 +-
 .../sp/jedit/menu/RecentDirectoriesProvider.java   |    2 +-
 org/gjt/sp/jedit/menu/RecentFilesProvider.java     |    2 +-
 .../sp/jedit/menu/ReloadWithEncodingProvider.java  |    4 +-
 org/gjt/sp/jedit/msg/BufferChanging.java           |    4 +-
 org/gjt/sp/jedit/msg/BufferUpdate.java             |    4 +-
 org/gjt/sp/jedit/msg/DockableWindowUpdate.java     |    4 +-
 org/gjt/sp/jedit/msg/DynamicMenuChanged.java       |    4 +-
 org/gjt/sp/jedit/msg/PluginUpdate.java             |    4 +-
 org/gjt/sp/jedit/msg/PositionChanging.java         |   22 +
 org/gjt/sp/jedit/msg/ViewUpdate.java               |    4 +-
 org/gjt/sp/jedit/options/AbbrevsOptionPane.java    |    4 +-
 org/gjt/sp/jedit/options/AppearanceOptionPane.java |    2 +-
 .../sp/jedit/options/BrowserColorsOptionPane.java  |    8 +-
 .../sp/jedit/options/BrowserContextOptionPane.java |  126 +-
 org/gjt/sp/jedit/options/BrowserOptionPane.java    |    4 +-
 org/gjt/sp/jedit/options/BufferOptionPane.java     |    2 +-
 org/gjt/sp/jedit/options/ContextOptionPane.java    |    4 +-
 org/gjt/sp/jedit/options/DockingOptionPane.java    |    2 +-
 org/gjt/sp/jedit/options/EditingOptionPane.java    |    4 +-
 org/gjt/sp/jedit/options/EncodingsOptionPane.java  |    4 +-
 org/gjt/sp/jedit/options/FirewallOptionPane.java   |    2 +-
 org/gjt/sp/jedit/options/GeneralOptionPane.java    |  109 +-
 org/gjt/sp/jedit/options/GlobalOptions.java        |    4 +-
 org/gjt/sp/jedit/options/GutterOptionPane.java     |    2 +-
 org/gjt/sp/jedit/options/MouseOptionPane.java      |    2 +-
 .../sp/jedit/options/PluginManagerOptionPane.java  |   24 +-
 org/gjt/sp/jedit/options/PluginOptions.java        |    2 +-
 org/gjt/sp/jedit/options/PrintOptionPane.java      |    2 +-
 org/gjt/sp/jedit/options/SaveBackupOptionPane.java |    4 +-
 org/gjt/sp/jedit/options/ShortcutsOptionPane.java  |   33 +-
 org/gjt/sp/jedit/options/StatusBarOptionPane.java  |    4 +-
 .../sp/jedit/options/SyntaxHiliteOptionPane.java   |    4 +-
 org/gjt/sp/jedit/options/TextAreaOptionPane.java   |    4 +-
 org/gjt/sp/jedit/options/ToolBarOptionPane.java    |    4 +-
 org/gjt/sp/jedit/options/ViewOptionPane.java       |   14 +-
 org/gjt/sp/jedit/pluginmgr/InstallPanel.java       |   54 +-
 org/gjt/sp/jedit/pluginmgr/KeyboardCommand.java    |    2 +-
 org/gjt/sp/jedit/pluginmgr/ManagePanel.java        |   65 +-
 org/gjt/sp/jedit/pluginmgr/MirrorList.java         |    8 +-
 org/gjt/sp/jedit/pluginmgr/MirrorListHandler.java  |    4 +-
 org/gjt/sp/jedit/pluginmgr/PluginDetailPanel.java  |    2 +-
 org/gjt/sp/jedit/pluginmgr/PluginList.java         |   28 +-
 org/gjt/sp/jedit/pluginmgr/PluginManager.java      |   89 +-
 .../sp/jedit/pluginmgr/PluginManagerProgress.java  |    2 +-
 org/gjt/sp/jedit/pluginmgr/Roster.java             |   18 +-
 org/gjt/sp/jedit/pluginmgr/plugins.dtd             |    4 +-
 org/gjt/sp/jedit/print/BufferPrintable.java        |    4 +-
 org/gjt/sp/jedit/print/BufferPrinter1_3.java       |    4 +-
 org/gjt/sp/jedit/print/BufferPrinter1_4.java       |   29 +-
 .../jeditresource/PluginResURLConnection.java      |   30 +-
 org/gjt/sp/jedit/search/AllBufferSet.java          |   32 +-
 .../sp/jedit/search/BoyerMooreSearchMatcher.java   |   15 +-
 org/gjt/sp/jedit/search/BufferListSet.java         |    6 +-
 org/gjt/sp/jedit/search/CurrentBufferSet.java      |    4 +-
 org/gjt/sp/jedit/search/DirectoryListSet.java      |   40 +-
 org/gjt/sp/jedit/search/HyperSearchFileNode.java   |    4 +-
 org/gjt/sp/jedit/search/HyperSearchFolderNode.java |    2 +-
 org/gjt/sp/jedit/search/HyperSearchNode.java       |    2 +-
 .../sp/jedit/search/HyperSearchOperationNode.java  |    4 +-
 org/gjt/sp/jedit/search/HyperSearchRequest.java    |   40 +-
 org/gjt/sp/jedit/search/HyperSearchResult.java     |    2 +-
 org/gjt/sp/jedit/search/HyperSearchResults.java    |   24 +-
 .../jedit/search/HyperSearchTreeNodeCallback.java  |    2 +-
 org/gjt/sp/jedit/search/SearchAndReplace.java      |   31 +-
 org/gjt/sp/jedit/search/SearchBar.java             |    6 +-
 org/gjt/sp/jedit/search/SearchDialog.java          |  231 +-
 org/gjt/sp/jedit/search/SearchMatcher.java         |    6 +-
 org/gjt/sp/jedit/services.xml                      |    8 +
 org/gjt/sp/jedit/syntax/Chunk.java                 |    2 +-
 org/gjt/sp/jedit/syntax/DefaultTokenHandler.java   |    4 +-
 org/gjt/sp/jedit/syntax/DisplayTokenHandler.java   |    4 +-
 org/gjt/sp/jedit/syntax/DummyTokenHandler.java     |    4 +-
 org/gjt/sp/jedit/syntax/KeywordMap.java            |    4 +-
 org/gjt/sp/jedit/syntax/ModeProvider.java          |    8 +-
 org/gjt/sp/jedit/syntax/ParserRule.java            |    4 +-
 org/gjt/sp/jedit/syntax/ParserRuleSet.java         |    5 +-
 org/gjt/sp/jedit/syntax/SyntaxStyle.java           |    4 +-
 org/gjt/sp/jedit/syntax/SyntaxUtilities.java       |    4 +-
 org/gjt/sp/jedit/syntax/Token.java                 |    4 +-
 org/gjt/sp/jedit/syntax/TokenHandler.java          |    4 +-
 org/gjt/sp/jedit/syntax/TokenMarker.java           |    4 +-
 org/gjt/sp/jedit/syntax/XModeHandler.java          |    4 +-
 org/gjt/sp/jedit/syntax/xmode.dtd                  |    1 -
 org/gjt/sp/jedit/textarea/Anchor.java              |    4 +-
 org/gjt/sp/jedit/textarea/AntiAlias.java           |    5 +-
 org/gjt/sp/jedit/textarea/BufferHandler.java       |    2 +-
 org/gjt/sp/jedit/textarea/ChunkCache.java          |  129 +-
 org/gjt/sp/jedit/textarea/CircleFoldPainter.java   |   70 +-
 org/gjt/sp/jedit/textarea/ColumnBlock.java         |  840 +++----
 org/gjt/sp/jedit/textarea/ColumnBlockLine.java     |  158 +-
 org/gjt/sp/jedit/textarea/DisplayManager.java      |    6 +-
 .../textarea/ElasticTabStopBufferListener.java     | 1085 +++++----
 .../jedit/textarea/ElasticTabstopsTabExpander.java |  190 +-
 org/gjt/sp/jedit/textarea/ExtensionManager.java    |    4 +-
 org/gjt/sp/jedit/textarea/FirstLine.java           |    5 +-
 org/gjt/sp/jedit/textarea/FoldPainter.java         |  156 +-
 org/gjt/sp/jedit/textarea/Gutter.java              |    4 +-
 org/gjt/sp/jedit/textarea/GutterPopupHandler.java  |   52 +-
 org/gjt/sp/jedit/textarea/InputMethodSupport.java  |    2 +-
 .../sp/jedit/textarea/JEditEmbeddedTextArea.java   |    2 +-
 org/gjt/sp/jedit/textarea/JEditTextArea.java       |    9 +-
 org/gjt/sp/jedit/textarea/MouseActions.java        |    2 +-
 .../sp/jedit/textarea/MouseActionsProvider.java    |    4 +-
 org/gjt/sp/jedit/textarea/MouseHandler.java        |   16 +-
 org/gjt/sp/jedit/textarea/Node.java                |   62 +-
 org/gjt/sp/jedit/textarea/RangeMap.java            |    2 +-
 org/gjt/sp/jedit/textarea/ScreenLineManager.java   |   39 +-
 org/gjt/sp/jedit/textarea/ScrollLayout.java        |    2 +-
 org/gjt/sp/jedit/textarea/ScrollLineCount.java     |    4 +-
 org/gjt/sp/jedit/textarea/Selection.java           |    4 +-
 org/gjt/sp/jedit/textarea/SelectionManager.java    |    5 +-
 org/gjt/sp/jedit/textarea/ShapedFoldPainter.java   |  166 +-
 org/gjt/sp/jedit/textarea/SquareFoldPainter.java   |   72 +-
 org/gjt/sp/jedit/textarea/StandaloneTextArea.java  |   33 +-
 org/gjt/sp/jedit/textarea/StructureMatcher.java    |    4 +-
 org/gjt/sp/jedit/textarea/TextArea.java            |    8 +-
 org/gjt/sp/jedit/textarea/TextAreaBorder.java      |    2 +-
 org/gjt/sp/jedit/textarea/TextAreaDropHandler.java |    4 +-
 org/gjt/sp/jedit/textarea/TextAreaException.java   |    4 +-
 org/gjt/sp/jedit/textarea/TextAreaExtension.java   |    4 +-
 .../sp/jedit/textarea/TextAreaMouseHandler.java    |    8 +-
 org/gjt/sp/jedit/textarea/TextAreaPainter.java     |   23 +-
 .../sp/jedit/textarea/TextAreaTransferHandler.java |   17 +-
 org/gjt/sp/jedit/textarea/TriangleFoldPainter.java |  148 +-
 org/gjt/sp/jedit/visitors/JEditVisitor.java        |    2 +-
 org/gjt/sp/jedit/visitors/JEditVisitorAdapter.java |    2 +-
 .../sp/jedit/visitors/SaveCaretInfoVisitor.java    |    2 +-
 org/gjt/sp/util/AwtRunnableQueue.java              |  168 ++
 org/gjt/sp/util/EnhancedTreeCellRenderer.java      |    2 +-
 org/gjt/sp/util/HtmlUtilities.java                 |  384 +--
 org/gjt/sp/util/IOUtilities.java                   |   93 +-
 org/gjt/sp/util/IntegerArray.java                  |    2 +-
 org/gjt/sp/util/Log.java                           |   55 +-
 org/gjt/sp/util/ProgressObserver.java              |    4 +-
 org/gjt/sp/util/PropertiesBean.java                |    4 +-
 org/gjt/sp/util/SegmentBuffer.java                 |    2 +-
 org/gjt/sp/util/StandardUtilities.java             |   32 +-
 org/gjt/sp/util/StringList.java                    |    2 +-
 org/gjt/sp/util/SyntaxUtilities.java               |    2 +-
 org/gjt/sp/util/Task.java                          |    7 +-
 org/gjt/sp/util/TaskAdapter.java                   |    2 +-
 org/gjt/sp/util/TaskListener.java                  |    2 +-
 org/gjt/sp/util/TaskManager.java                   |   85 +-
 org/gjt/sp/util/ThreadAbortMonitor.java            |    2 +-
 org/gjt/sp/util/ThreadUtilities.java               |  492 ++--
 org/gjt/sp/util/WorkRequest.java                   |  136 --
 org/gjt/sp/util/WorkThread.java                    |  246 --
 org/gjt/sp/util/WorkThreadPool.java                |  488 ----
 org/gjt/sp/util/WorkThreadProgressListener.java    |   35 -
 org/gjt/sp/util/XMLUtilities.java                  |    9 +-
 org/jedit/core/FileOpenerService.java              |    3 +-
 org/jedit/core/MigrationService.java               |   85 +-
 org/jedit/io/Native2ASCIIEncoding.java             |  474 ++++
 org/jedit/keymap/Keymap.java                       |   98 +-
 org/jedit/keymap/KeymapFileFilter.java             |   80 +-
 org/jedit/keymap/KeymapImpl.java                   |  331 +--
 org/jedit/keymap/KeymapManager.java                |  182 +-
 org/jedit/keymap/KeymapManagerImpl.java            |  481 ++--
 org/jedit/localization/jedit_cs.props              |   18 +-
 org/jedit/localization/jedit_de.props              | 1750 ++++++++------
 org/jedit/localization/jedit_en.props              |   90 +-
 org/jedit/localization/jedit_fr.props              |   36 +-
 org/jedit/localization/jedit_ja.props              |   55 +-
 org/jedit/localization/jedit_ru.props              |   10 +-
 org/jedit/localization/jedit_zh.props              | 2536 ++++++++++++++++++++
 .../migration/CheckFileStatus.java}                |   95 +-
 org/jedit/migration/KeymapMigration.java           |  134 +-
 org/jedit/migration/OneTimeMigrationService.java   |   83 +
 org/jedit/options/CombinedOptions.java             |    3 +-
 org/jedit/options/GlobalOptionGroup.java           |    2 +-
 org/jedit/options/OptionGroupPane.java             |   52 +-
 org/jedit/options/PluginOptionGroup.java           |    2 +-
 org/jedit/options/TabbedOptionDialog.java          |    4 +-
 package-files/linux/jedit                          |    6 +-
 package-files/os2/jedit.cmd                        |   73 +
 test/org/jedit/io/Native2ASCIIEncodingTest.java    | 1598 ++++++++++++
 533 files changed, 21554 insertions(+), 12614 deletions(-)

diff --git a/README.SRC.txt b/README.SRC.txt
index ef03ff6..e807af7 100644
--- a/README.SRC.txt
+++ b/README.SRC.txt
@@ -1,6 +1,7 @@
 SOURCE CODE NOTES
 
 This file only contains information about compiling from source.
+Scroll to the bottom if you are trying to use an IDE like Eclipse.
 General jEdit documentation can be found in the 'doc' directory.
 
 * Requirements
@@ -176,16 +177,32 @@ General jEdit documentation can be found in the 'doc' directory.
 
 * Tips for Eclipse/NetBeans/IDE users:
 
+A file "jsr305.jar" contains definitions of the annotations 
+used in jEdit source code. It is downloaded automatically by ivy 
+as part of the ant build process, to your lib/compile subfolder.
+If you add that jar to the
+project properties - java build path - libraries, that will
+get rid of the compiler errors on the annotations.
+
+A file "tools.jar" from the JDK is also needed in your 
+java build path. 
+
+The ant build process creates a subfolder called "build" for its work.
+Eclipse does the same and may pick the same folder. 
+It is recommended you check/ensure that a different build
+directory ("Default Ouptut Folder") for Eclipse is used. 
+
 Some of the source directories are only needed for building packages on
 certain platforms. If you add jEdit source to an IDE like Eclipse that tries
-to build everything, you'll get some errors from these directories unless
-you have the right libraries. However, if you tell Eclipse to exclude these
-directories, you can still build and run/debug jEdit from source.
-Follow these steps:
+to compile every .java file, you'll get some errors from these directories unless
+you have the right libraries, which are automatically downloaded by ivy.
+However, if you tell Eclipse to exclude these directories, 
+you can still build and run/debug jEdit from source. Follow these steps:
 
  - Project properties - Java build path
  - Source - Excluded dirs - Edit - Add multiple
- - Add these subdirs: net, de, build
+ - Add these subdirs: net, de, build, test, misc
+ - Default output folder: /build-eclipse
 
 The "eclipse-formatting.xml" file can be used to set the
 code format style to be the same as what is currently used here.
diff --git a/build.xml b/build.xml
index 81f92ed..30f7fd5 100644
--- a/build.xml
+++ b/build.xml
@@ -107,7 +107,7 @@
 
 	<target name="init-ivy"
 		depends="init,download-ivy"
-		unless="ivy.done">
+		unless="${ivy.done}">
 		<property name="ivy.retrieve.pattern"
 			  value="${lib.dir}/[conf]/[artifact](-[classifier]).[ext]"/>
 		<taskdef resource="org/apache/ivy/ant/antlib.xml"
@@ -120,7 +120,7 @@
 	<target name="retrieve"
 		description="retrieve the dependencies"
 		depends="init,init-ivy"
-		unless="ivy.done">
+		unless="${ivy.done}">
 		<ivy:retrieve sync="true"/>
 		<ivy:retrieve pattern="${lib.dir}/ivy/[artifact]-[revision].[ext]"
 			      organisation="org.apache.ivy"
@@ -299,7 +299,9 @@
 				<include name="org/gjt/sp/jedit/buffer/LineManager.java"/>
 				<include name="org/gjt/sp/jedit/buffer/PositionManager.java"/>
 				<include name="org/gjt/sp/jedit/buffer/UndoManager.java"/>
-
+                
+				<include name="org/gjt/sp/jedit/bufferio/IoTask.java"/>
+                
 				<include name="org/gjt/sp/jedit/gui/KeyEventTranslator.java"/>
 				<include name="org/gjt/sp/jedit/gui/KeyEventWorkaround.java"/>
 				<include name="org/gjt/sp/jedit/gui/MutableListModel.java"/>
@@ -392,6 +394,7 @@
 				<include name="org/gjt/sp/util/Task.java"/>
 				<include name="org/gjt/sp/util/TaskManager.java"/>
 				<include name="org/gjt/sp/util/TaskListener.java"/>
+				<include name="org/gjt/sp/util/AwtRunnableQueue.java"/>
 				<include name="org/gjt/sp/util/ThreadUtilities.java"/>
 				<include name="org/gjt/sp/util/SyntaxUtilities.java"/>
 				<include name="org/gjt/sp/util/XMLUtilities.java"/>
@@ -415,6 +418,10 @@
 		       encoding="UTF-8"
 		       includeAntRuntime="false">
 			<compilerarg line="${config.build.compilerarg}"/>
+            <classpath id="classpath.compile">
+				<fileset dir="${lib.dir}/compile"
+					 includes="*.jar"/>
+			</classpath>
 		</javac>
 	</target>
 
@@ -443,7 +450,7 @@
 	</target>
 
 	<target name="build"
-		depends="init,retrieve,setup,compile,test"
+		depends="init,retrieve,setup,compile"
 		description="build the jEdit JAR-file with full debug-information">
 		<mkdir dir="${jar.location}"/>
 		<jar destfile="${jar.location}/${jar.filename}"
@@ -994,6 +1001,12 @@
 				    dir="${dist.dir}"
 				    includes="doc/api/**"/>
 		</tar>
+		<tar destfile="${dist.dir}/jedit-os2.tar.bz2"
+		     compression="bzip2">
+			<tarfileset id="jedit-os2"
+				    dir="${dist.dir}/classes/package-files/os2"
+				    includes="jedit.cmd"/>
+		</tar>
 		<antcall target="compile-installer">
 			<param name="config.build.debuglevel"
 			       value="lines,source"/>
@@ -1030,6 +1043,10 @@
 				   disksizeproperty="jedit-api.disksize">
 			<fileset refid="jedit-api"/>
 		</mod:calculatesize>
+		<mod:calculatesize realsizeproperty="jedit-os2.realsize"
+				   disksizeproperty="jedit-os2.disksize">
+			<fileset refid="jedit-os2"/>
+		</mod:calculatesize>
 		<copy todir="${dist.dir}/classes/installer/installer"
 		      encoding="UTF-8"
 		      overwrite="true">
@@ -1057,6 +1074,10 @@
 					value="${jedit-api.realsize}"/>
 				<filter token="jedit-api.disksize"
 					value="${jedit-api.disksize}"/>
+				<filter token="jedit-os2.realsize"
+					value="${jedit-os2.realsize}"/>
+				<filter token="jedit-os2.disksize"
+					value="${jedit-os2.disksize}"/>
 			</filterset>
 		</copy>
 		<jar destfile="${dist.dir}/${dist.jar.filename}"
@@ -1075,6 +1096,7 @@
 				    includes="jedit-api.tar.bz2
 					      jedit-mac.tar.bz2
 					      jedit-macros.tar.bz2
+					      jedit-os2.tar.bz2
 					      jedit-windows.tar.bz2
 					      jedit-program.tar.bz2"
 				    prefix="installer"/>
diff --git a/doc/CHANGES.txt b/doc/CHANGES.txt
index 9ba50ae..db1434f 100644
--- a/doc/CHANGES.txt
+++ b/doc/CHANGES.txt
@@ -1,444 +1,286 @@
-jEdit 5.0 version history
-       (changes since jEdit 4.5.2)
+jEdit 5.1 version history
+       (changes since jEdit 5.0.0)
 :encoding=UTF-8:
 
-{{{ Version 5.0.0
+{{{ Version 5.1.0
 
-Thanks to Jarek Czekalski, Eric Le Lay, Matthieu Casanova, Tom Power, Malathi,
-Thomas Meyer, Vladimir Avondin, Björn "Vampire" Kautler and Alan Ezust for
-contributing to this release. 
+Thanks to Alan Ezust, Matthieu Casanova, and Björn "Vampire" Kautler
+for contributing to this release.
 
-{{{ Bug fixes
-
-- Does not create backups on exit (#3579788 Jarek Czekalski)
-
-- I/O Error on First Save Attempt (#3574500 Jarek Czekalski) 
-
-- Fixed whole word search (#3551515 Matthieu Casanova)
-
-- Fixed a number of scrollbar bugs related to undo, multiline cut,
-  soft-wrap, and folding.
-  (Patch#3567959, Bugs #2832769, #2998294, and #3193168 - Thomas Meyer)
-
-- Fix keymap duplication handling (Björn "Vampire" Kautler)
-
-- Fix broken macro Files/Glob_close.bsh (Eric Le Lay)
-
-- File status checking before save (#3562315, Alan Ezust)
-
-- Fix "Customize This Menu..." item in context menu options (#3554895 Tom Power)
-
-- Fixed the StandaloneTextArea that cannot load keymaps
-  (#3562023 Matthieu Casanova)
-
-- Fix a case where a NPE occurs when removing a plugin
-  (#3557441 Matthieu Casanova)
-
-- Recognizing "Extra word characters" in "Whole word" option in
-  searches (bug #3522497, patch #3543524 Malathi)
-
-- The macro Display_Abbreviations was broken (#3539691 Matthieu Casanova)
-
-- Fix pressing return in parent files of the VFS browser that do not
-  browse the selected folder as it should (patch #3543499 by Eric Le Lay)
+{{{ UI improvements
 
-}}}
-{{{ API
-
-- New method MiscUtilities.openInDesktop() (Alan Ezust)
-
-}}}
-{{{ UI
-
-- Disable menu bar mnemonics if they are mapped as otherwise defined shortcuts
-  so that they are not shown visually to the user when they actually do not
-  work and make sure that no conflict can arise with the default keymap and
-  any localization (#3528208 Björn "Vampire" Kautler)
-
-- Added a new German keymap. Replaced shortcuts that were unreachable
-  on a german keyboard. Moved shortcuts from German localization into
-  keymap. (#3572796 Björn "Vampire" Kautler)
-
-- Translate underscores to spaces when displaying keymap names in the UI to
-  eliminate files with spaces in the name. (Björn "Vampire" Kautler)
+- The column titles were missing in shortcuts option pane
+  (#3614404 Matthieu Casanova)
 
-- Fix broken keymap properties (Björn "Vampire" Kautler)
+- Made TextArea thick caret thicker, and also thick when in overwrite mode.
+  (#3614784 Alan Ezust)
 
-- Added russian localization (patch #3544154 Vladimir Avdonin)
+- Added a new column "ActionSet" in Shortcuts option pane to know
+  to which actionSet an action belongs (feature #3614386 Matthieu Casanova)
 
 }}}
-{{{ Miscellaneous
-
-- Correctly determine whether Look and Feel did change to not touch it if it
-  stays the same as this might cause delays and Exceptions.
-  (Björn "Vampire" Kautler)
-
-- The .jedit/modes/catalog is now written using UTF-8 instead of default
-  OS encoding (#3560800 Matthieu Casanova)
 
 }}}
 
-}}}
+{{{ Version 5.1pre1
 
-{{{ Version 5.0pre1
-
-Thanks to Björn "Vampire" Kautler, Nathan Gray, Evan Wright, Alan Ezust, Dale
-Anson, Matthieu Casanova, Olivier Pisano, Jimmy Chaw, peibl, Robert Schwenn,
-Martin Raspe, Max Funk, SPennington, Ingo Tomahogh, Jarek Czekalski, Jojaba,
-Stephen Blackheath, Milan Černil, Makarius, Chris Sullins, Peter C. Chapin,
-Tom Power and Donovaly for contributing to this release.
+Thanks to Björn "Vampire" Kautler, Jarek Czekalski, Thomas Meyer,
+Matthieu Casanova, cnvince, Alan Ezust, Malathi, Vladimir Avdonin, Eric Le Lay,
+Darien Brown, Steve snarum-micron, EdorFaus, Brian Clapper, Uwe Stöhr,
+Marc Häfner, stone1343, Richard The, Dale Anson, Benjamin Gmurczyk,
+Makarius, Marco Hunsicker, and Maik Nijhuis for contributing to this release.
 
 {{{ Bug fixes
 
-- Fixed exception in dockable window system when loading a plugin using
-  jar libraries (#3532429 Matthieu Casanova)
+- The contextInsensitive flag of the edit mode was not used at the first use
+  of the edit mode (Matthieu Casanova)
 
-- The plugin description in install panel now supports html
-  (#3509183 Matthieu Casanova)
+- Fix mode loading for temporary buffers (patch #3609469 Thomas Meyer)
 
-- The mirror "Plugin Central default" now works as auto selecting
-  mirror and is used by default. Previous default was hardcoded "switch"
-  (mirror.switch.ch) as workaround, but one could easily stuck on broken
-  "Plugin Central default" and got strange errors.
-  (#2913393, #3501210 - Kazutoshi Satoda)
+- Fix #3598661 - Don't allow negative values in the general option pane.
+  (Thomas Meyer)
 
-- Avoided annoying behavior of electric keys that canceled obvious
-  manual indentation. Now they take effect only when the current level
-  of indentation is same with automatic indentation.
-  (#1936678, #2332140 Jarek Czekalski, Kazutoshi Satoda)
+- Fix #3596215 - NPE from docking layout save/loads when started with
+  -nosettings. (Alan Ezust)
 
-- Fixed "Backup on every save" resets file permissions. Renaming of the file
-  was replaced with copying. (#1803073 Jarek Czekalski)
+- Fix #3597101, #3596600 - Bad error handling when an invalid path is entered
+  into the VFS Browser inputs. (Patch# 3602318 Benjamin Gmurczyk)
 
-- Added backup of remote files, for example opened with FTP plugin.
-  (#1525654 Jarek Czekalski)
+- Bug no. #3590540 revealed a performance problem in the ChunkCache, because
+  every scroll action resulted in a tokenization of the really long line, which
+  takes a considerable time and makes jEdit unusable.
+  Fix is to always keep all Chunks of the tokenization process and use it as an
+  buffer in the ChunkCache class.
+  Tokenization of the physical line still happens for every insertion or
+  deletion of the Buffer. Tokenization also happens when the cursor enters the
+  physical line, as only the Chunks from the current physical line are keeped
+  in the ChunkCache.
+  (#3590540 Thomas Meyer)
 
-- Fixed NPE which was shown in place of a proper error message for empty
-  keyword elements in mode XML. (Kazutoshi Satoda)
+- Bug no. #3590540 produced a soft wrap for a single physical line that was
+  greater than 16383 screen lines. Increased this limit to 65535 in
+  the ScreenLineManager (#3590540 Thomas Meyer)
 
-- Cannot DnD betweeen PingPongLists (#3501020 Jarek Czekalski)
+- Fixed Insert_Selection macro when the selection is empty (#3596616
+  Matthieu Casanova)
 
-- Fixed macros at menu split are unaccessible (#3512853 Jarek Czekalski)
+- fixed bug when pressing down if the is no selection (#3599630
+  Matthieu Casanova)
 
-- If the same plugin is installed in home and install folder, only the newest
-  is loaded. (#1848802 Matthieu Casanova)
+- Fixed macros cut lines and copy lines when the buffer is empty (#3596612
+  Matthieu Casanova)
 
-- Fixed rectangular selection constructor (patch #3440310 peibl)
+- Fixed negative values used in recent file history count (#3598661 Matthieu
+  Casanova)
 
-- When copying a file in VFSBrowser, if a file with the same name already exists
-  a suffix copy-n is added to avoid deleting the existing file
-  (#3470759 Matthieu Casanova)
+- Fixed Run script macro when the file is empty (#3596609 Matthieu
+  Casanova)
 
-- Fixed Ctrl + key not working in completion popup (Matthieu Casanova)
+- Fixed Get_Class_Name macro when the file is empty (#3596752 Matthieu
+  Casanova)
 
-- Fixed copy of Hypersearch results adding \r in the clipboard
-  (#3142456 Matthieu Casanova)
+- Re-added missing OS/2 support code. (#3589903 Alan Ezust)
 
-- The Java based installer now correctly handles GNU style long filenames in
-  the installer package and thus does not corrupt the JavaDoc files anymore
-  (#2327520 Björn "Vampire" Kautler)
+- Added missing localization string:
+  options.plugin-manager.list-cache.minutes (#3574373 Matthieu Casanova)
 
-- Several message boxes were not being created on the EDT which would result in
-  tiny, non-resizable message boxes. (#3441535 Dale Anson)
+- Fix AutoSave exception after multiline cut (#3017650 Thomas Meyer)
 
-}}}
-{{{ API Changes
+- Undomanager: Don't compact significant edits (#patch 3560615 Thomas Meyer)
 
-- New method Debug.compDelay, for debugging purposes (Jarek Czekalski)
+- Fixed undo after replace all with beanshell only first occurance
+  (#3551910 Thomas Meyer)
 
-- Made EditBus.send uninterruptible, as it was before putting handling of
-  messages into EDT (r17139, to 4.4).
+- Search all buffers now observes current BufferSet scope and can be restricted
+  to the current view's buffers when scope is not global. (#3423442 Alan Ezust)
 
-- New method ThreadUtilities.runInDispatchThreadNow() (Jarek Czekalski)
+- Fix File status checking after buffer switch (#1871440 Alan Ezust)
 
-- New VFS capability: NON_AWT_SESSION_CAP and a helper method
-  VFS.createVFSSessionSafe that frees the caller from entering the EDT
-  thread in most cases. All built-in filesystems have this capability set.
-  (Jarek Czekalski)
-
-- The status bar widget service is now
-  org.gjt.sp.jedit.gui.statusbar.StatusWidgetFactory instead of
-  org.gjt.sp.jedit.gui.statusbar.StatusWidget (only the name in service.xml)
-  is modified, because the service class is a StatusWidgetFactory and not a
-  StatusWidget (#3521413 Matthieu Casanova)
+- Undo restores selection state in simple cases (deletions, replaces
+  on simple range selections). (patch #1570553 Maik Nijhuis, Thomas Meyer,
+  Jarek Czekalski)
 
-- New public constructor for org.gjt.sp.jedit.gui.ErrorListDialog
-  allowing for specifying custom urgency (priority). (Jarek Czekalski)
+- Filter not synchronizing in search dialog when
+  "All buffers" is selected. (#1646584, patch #3549905 Eric Le Lay)
 
-- TextArea.isCaretVisible became public (patch #3518424 Makarius)
+- Fixed VFS session not ended in VFS.copy() api (#3522406 Matthieu Casanova)
 
-- Fixed jedit exit procedure. Now all views are closed. Earlier only
-  the current view was properly closed. This may be important for plugins
-  that were workarounding the issue, as now they will get more
-  ViewUpdate.CLOSED messages. (Jarek Czekalski)
+- Use of a scrollable list for delete dialog confirmation
+  (#2911520 Matthieu Casanova)
 
-- The JEditEmbeddedTextArea and StandaloneTextArea do not create an empty
-  popup menu anymore.
-  To add a context menu in your JEditEmbeddedTextArea, please override
-  createPopupMenu(MouseEvent evt) as before, but also call
-  setRightClickPopupEnabled(true) in your constructor (Matthieu Casanova)
+- Fix selecting mode based on exact filename match. (#3562935 Dale Anson)
 
-- New jEdit.getCurrentLanguage() method that returns the language used  by jEdit
-  (Matthieu Casanova)
+- Fix old modes/catalog entries clutter properties. (#3533751 Eric Le Lay)
+  [Merged into 5.0.x]
 
-- New method JEditBuffer.insert(int offset, CharSequence seq) to insert
-  text in a buffer. (Matthieu Casanova)
-
-- New constructors for CopyFileWorker:
-  CopyFileWorker(Component comp, VFSFile[] vfsFiles, String target)
-  CopyFileWorker(Component comp, VFSFile[] vfsFiles, String target,
-                 Behavior behavior)
-  CopyFileWorker(Component comp, File[] files, String target)
-  CopyFileWorker(Component comp, File[] files, String target, Behavior behavior)
-  to allow copy of multiple files at the same time (Matthieu Casanova)
-
-- New VFS.copy() methods:
-  copy(ProgressObserver progress, VFS sourceVFS, Object sourceSession,
-       String sourcePath, VFS targetVFS, Object targetSession,
-       String targetPath, Component comp, boolean canStop,
-       boolean sendVFSUpdate)
-  copy(ProgressObserver progress, String sourcePath,String targetPath,
-       Component comp, boolean canStop, boolean sendVFSUpdate)
-  (Matthieu Casanova)
-
-- New methods MiscUtilities.getCompleteBaseName() to return
-  the (complete) base names of a file (until the last .) and
-  and getBaseName(), to replace the badly named getFileNameNoExtension,
-  which is now deprecated (Matthieu Casanova, Alan Ezust)
-
-- TextUtilities.join() now accept Collection<?> instead of Collection<String>
-  (Matthieu Casanova)
+- When checking a box to select a plugin to install, the description was
+  appearing and immediately disappearing. (#3398605 Dale Anson)
 
-- OperatingSystem.isOS2() method is removed since OS/2 cannot run jEdit since
-  many years (Matthieu Casanova)
-
-- OperatingSystem.isDOSDerived() is now deprecated since OS/2 do not exists
-  anymore Windows is the only DOS derived OS, so use OperatingSystem.isWindows()
-  instead (Matthieu Casanova)
-
-- Some undocumented but public members in class DisplayTokenHandler and
-  Chunk became private as they should be in the first place.
-    Specifically:
-      org.gjt.sp.jedit.syntax.DisplayTokenHandler
-        MAX_CHUNK_LEN
-        initChunk()  (* this was protected)
-      org.gjt.sp.jedit.syntax.Chunk
-        accessable
-        initialized
-        style
-        width
-        Chunk constructors
-        offsetToX() (non static)
-        xToOffset() (non static)
-        init()
-  (Kazutoshi Satoda)
+- Fix Exception when clicking Find orphan when disabled plugins (#2940864 Eric
+  Le Lay)
 
 }}}
-{{{ Editing
-
-- Nsis mode: added sectiongroup and deprecated subsection.
-  (patch #3531776 Uwe - donovaly)
-
-- Shellscript mode: changed electric keys to better fit current jEdit
-  capabilities in this area. (Jarek Czekalski)
-
-- Made markers list selectable with keyboard. (patch #3509642 Tom Power)
-
-- Ada mode improvements (patch #3523836 Peter C. Chapin,
-  request #2860105 Britt)
-
-- Scala mode added (#3501401 Daniel Spiewak)
-
-- logs edit mode added (Matthieu Casanova)
-
-- Dart mode added (patch #3483431 Chris Sullins)
-
-- Haskell mode: Removed the fixed 8 character indent and tab size
-  (patch #3470636)
+{{{ API Changes
 
-- Haskell mode: Added some GHC extensions: recursive do and arrow notation
-  (patch #3470637 Stephen Blackheath)
+- TaskManager: Refactor io task - New class IoTask, a subclass of Task
+  Remove the code of the io special case in TaskManager (Thomas Meyer)
 
-- New mxml.xml mode, and updates to ActionScript (patch #2913561 Chris Hill)
+- Make SearchMatcher interrupttible (Thomas Meyer)
+  1.) API change: let SearchMatcher.nextMatch() throw InterruptedException
+  2.) BoyerMooreSearchMatcher: Switch to the new API and react on thread
+      interruption
 
-- New metapost.xml mode (patch #1606258 Kondr)
+- HyperSearch: Make search interruptible even when in VFS.listFiles():
+  New method TaskManager.cancelTasksByClass(): Interrupt all currently running
+  Tasks of the given type. (Thomas Meyer)
 
-- Updated cobol.xml (patch #2654343 Markus Röhner)
+- Deprecated extra overloads of IOUtilities.closeQuietly() in favor of
+  using Java5 closeQuietly(Closeable) instead. (Alan Ezust)
 
-- fortran90.xml: new Fortran90 edit mode (patch #2406563 Jonni Lehtiranta)
+- New class: OneTimeMigrationStep, for adding property migration services
+  (used by fix for #1871440 Alan Ezust)
 
-- roff.xml: New ROFF/GROFF/TROFF edit mode
-  (patch #3081484 Kostas Michalopoulos, Robert Schwenn)
+- New method VFSBrowser.getLastVisitedPath() (Jarek Czekalski)
 
-- nsis2.xml: Added Java/C style comments. (patch #2976473)
+- New method IOUtilities.closeQuietly(ObjectInput) (Matthieu Casanova)
 
-- Ruby Edit Mode: Improved Symbol Highlighting
-  (patch #1918110 Ingo Tomahogh, Alan Ezust)
+- New method IOUtilities.closeQuietly(ObjectOutput) (Matthieu Casanova)
 
-- "velocity_pure.xml" edit mode to replace older sgml-based velocity.xml.
-  Velocity keywords nested within markup tags incorrectly highlighted.
-  (patch #1285741 Robert Schwenn)
+- New method GUIUtilities.setAutoMnemonic(AbstractButton) (Jarek Czekalski)
 
-- Updated D edit mode (patch #3463009 Olivier Pisano)
+- New method: View.getBuffers(), aware of bufferset scope. (Alan Ezust)
 
-- Removed special highlight for object access and creation in php edit mode
-  (#2985508, #3151072 Matthieu Casanova)
+- Removed View.setBuffer(Buffer, boolean, boolean) and
+  View.setBuffer(Buffer, boolean): methods that had disableFileCheck flag in
+  since View no longer checks file status there. (#1871440 Alan Ezust)
 
-- Major simplification of phpdoc to make it look more like javadoc
-  (#1803310, #3029383, #3316733 Matthieu Casanova)
+- AllBufferSet.AllBufferSet(String glob, View v) - additional required
+  argument for View in constructor argument list. (#3423442 Alan Ezust)
 
-- Added some missing keywords to vrml2 edit mode (patch #3471586 Jimmy Chaw)
+- Removed classes: IOProgressMonitor, WorkRequest, WorkThreadPool,
+  WorkThreadProgressListener (Thomas Meyer)
 
-- Using no highlight or limited syntax highlight in large buffers now also
-  disables soft wrap (Matthieu Casanova)
+- Removed VFSManager.getIOThreadPool() (Thomas Meyer)
 
-- Using no highlight or limited syntax highlight in large buffers now disables
-  highlight of very long lines (Matthieu Casanova)
+- Converted BufferIORequest, VFSFileChooserDialog.GetFileTypeRequest and
+  TextAreaTransferHandler.DraggedURLLoader to a Task (Thomas Meyer)
 
-- Latex Indentation a nuisance (#3432974)
+- Converted TaskManager to an enum singelton (Thomas Meyer)
 
-- Made it possible to disable automatic indentation by buffer or by edit
-  mode, and created a status widget to toggle the setting (Evan Wright)
+- Changed VFSManager.runInWorkThread(Runnable) to
+  VFSManager.runInWorkThread(Task) and made it accept only IO tasks
 
-- Fix for tracker 2976661, script tag attributes not syntax highlighted.
-  (Dale Anson)
+- New class: AwtRunnableQueue (Thomas Meyer)
 
-- Fix for tracker 846913, jsp syntax highlighting for single line comments.
-  (Dale Anson)
+}}}
+{{{ Editing
 
-- Updated css mode with new css 3 properties and values, tracker 3483390.
-  (Dale Anson)
+- Fixed bug in ruby multiline comments (Patch#3605738 fixing bug #3605168
+  Richard The)
 
-- Updated html mode to recognize new html 5 keywords, updated jsp mode to
-  delegate to html mode for html tags. (Dale Anson)
+- Fixed shellscript highlight (patch #3602461 fixing bug #3594428 Richard The)
 
-}}}
-{{{ UI
+- Updated lua mode file (patch #2126692 stone1343)
 
-- Made "Customize This Menu..." item in context menu optional.
-  (patch #3530786 Tom Power)
+- Macros move lines up/down now keep the current selection (feature #3600082
+  Matthieu Casanova)
 
-- File System Browser docked on left by default. (Alan Ezust)
+- Updated nsis2 mode (#3586538 Uwe Stöhr)
 
-- Suppressed output to standard error of encoding problems on opening
-  files, which affects also hypersearch encoding errors. These errors are
-  now displayed in a dialog, but not sent to error output.
-  (request #3517116 Jarek Czekalski)
+- There is now a new encoding Native2ASCII which collapses unicode
+  escapes in ISO-8859-1 files on read and expands characters that cannot be
+  encoded with ASCII as unicode escapes on write. This encoding is the one Java
+  properties files should be in. (Björn "Vampire" Kautler)
 
-- Reserve space for 4 digit in memory's status bar widget.
-  (patch #3518422 Makarius)
+- Highlight entity references in xml attributes (#3559971 Eric Le Lay)
 
-- The Windows installer and windows integration are now localized in french
-  (patch #3513215 Jojaba)
+- Added highlight of chapter title in rfc edit mode (Matthieu Casanova)
 
-- The Error status bar widget now use a JEditEmbeddedTextArea instead of a
-  simple swing TextArea to display exceptions (Matthieu Casanova)
+- Fixed shellscript do escape single quote with backslash
+  (#3557453 Matthieu Casanova)
 
-- jEdit now supports localization. (Matthieu Casanova)
+- Updated ColdFusion mode (#3518536, #3561048 Darien Brown)
 
-- Added french translation (Jojaba http://jojaba.free.fr)
+- Updated Verilog mode (#3536967 Steve snarum-micron)
 
-- Added german translation (Robert Schwenn)
+- Updated HTML mode (#3594526 Marc Häfner)
 
-- Added czech translation (patch #3523511 Milan Černil)
+- Updated CSS mode (#3595041 Marc Häfner)
 
-- Text Area option for Search System Fonts in Font substitution
-  (#3479585 Max Funk)
+- Updated Coffeescript mode (#3595105 Marc Häfner)
 
-- Dialog titles in file system browser
-  (patch #2968930, request #2807301 SPennington)
+- new PostgreSQL mode (feature #2833378 Thiemo Kellner, Eric Le Lay)
 
-- Standarized Buffer Switcher combo (#3408584, patch #3456572 Jarek Czekalski)
+}}}
+{{{ UI improvements
 
-- If a Task is not cancellable, the cancel button of TaskMonitor is disabled
+- Better information in the plugin manager when loading plugin list
   (Matthieu Casanova)
 
-- Added Icons to the VFS Browser context menu (Matthieu Casanova)
+- Initial view hidden by other windows at startup (#3610089)
 
-- Combined Global and Plugin options into a single pane, making Optional plugin
-  obsolete, fixing auto resize dialog issue.
-  (#3449498, request #3455602 Alan Ezust)
+- Remove empty root node in OptionGroupPane
+  (#3608324, #3608327: Marco Hunsicker)
 
-- jEdit is now always using continuous layout in JSplitPane (Matthieu Casanova)
+- More accurate treatment of ALT_KEY_PRESSED_DISABLED (#3604532: Makarius)
 
-- Fixed keyboard handling of comboboxes in jedit's option panes.
-  (#3415064 Alan Ezust)
+- New view option: "Abbreviate paths with environment variables when possible".
+  (#3606329 Alan Ezust)
 
-- Changed menus to use Mac-specific symbols for accelerator keys when using OS X
-  and the native look & feel (patch #1950147 Nathan Gray)
+- Made view option, "alternate toolbar placement" the default for jEdit.
 
-- Added an option (on by default) to use the native Quartz renderer on
-  Mac OS X (Evan Wright)
+- Emacs macros and keymap updates. (Brian Clapper)
 
-- Fixed keyboard handling of drop-down menus in File System Browser.
-  (#1571578 Alan Ezust)
+- Use separate (shorter) label for "whole word search" in the search bar.
+  (Shlomy Reinstein)
 
-- Fixed "Use textarea colors" for dockables created in non-metal L&F.
-  (#1794400 Alan Ezust)
+- Added a right click popup menu with a copy action in the Error dialog
+  (#3557023 Matthieu Casanova)
 
-- New option in Saving and Backup pane: Use File System Browser dir for
-  Save-As (#1591441 Alan Ezust)
+- Avoid trouble with horizontal scrolling (Patch #3134788, EdorFaus)
 
-- RegisterViewer: set initial focus to registerList, added key bindings for
-  inserting content, clearing a register and leaving the registerList
-  (#3437779 Martin Raspe)
+- Enable ContextMenu via keyboard to VFS-BrowserView (#3560239, Thomas Meyer)
 
-- RegisterViewer: close the floating window after inserting a clip, to make
-  behaviour consistent with Paste Previous window (#3478916 Jarek Czekalski)
+- Added a possibility to suppress synchronization of the filter in search
+  dialog, using a hidden setting in jedit.props: search.dontSyncFilter.
+  (Jarek Czekalski)
 
-- Show a preview of the window rather than a low-resolution icon when minimizing
-  on Mac OS X (#3529980 Evan Wright)
+- Added mnemonics for popup menus in File System Browser (Commands, Plugins,
+  Favorites). (Jarek Czekalski)
 
 }}}
 {{{ Miscellaneous
 
-- New FileOpenerService, Offered by FastOpen 2.5, SmartOpen 1.1.
-  Used by ErrorList 2.0 (#3481157 Alan Ezust)
-
-- jeditresource:/ URL handler now also checks jEditHome for files so
-  it can be used to link to core documentation. (#3565139 Alan Ezust)
-
-- Macros folder can now be localized with properties
-  macros.folder.[foldername].label (Matthieu Casanova)
+- Added Chinese translation (patch #3611777 cnvince)
 
-- Pasting a VFSFile as String dataflavor will now paste the full path instead of
-  the name of the file (Matthieu Casanova)
-
-- The EditingOptionPane has now an option to remember the user choice about
-  large file treatment (Matthieu Casanova)
-
-- OS/2 tasks were removed from the Java installer as OS/2 does not
-  have a working Java 6 implementation and probably never will have
-  (Björn "Vampire" Kautler)
+- Made the plugin manager loading much faster (up to 3 time faster)
+  (Matthieu Casanova)
 
-- jEdit support for keymaps (Matthieu Casanova)
+- New macro in Files section: "Open Selection In Desktop" (Jarek Czekalski)
 
-- User Settings directory migrated to %APPDATA%/jEdit on Windows
-  (#2510763 Alan Ezust)
+- Open Selection macro improvements. An attempt is made to use current
+  VFS browser directory as a parent for the highlighted filename.
+  In case of no selection the path under caret is used. (Jarek Czekalski)
 
-- Added support for "Find Previous" when searching in multiple files
-  (Evan Wright)
+- Fixed unreasonable quadratic operations which could be observable on
+  big search&replace-all. (Patch #3533838 by Thomas Meyer)
 
-- Applied patch to Get_Class_Name macro from lxdyglt to find
-  classname for inner classes. (#3301598 Dale Anson)
+- Avoided unreasonable memory consumption by duplicate String instances
+  that could be allocated for each occurrence in a big
+  search&replace-all. (Patch #3528619 by Thomas Meyer)
 
-- Fixed some edge cases in the Make_Get_and_Set_Methods macro, properly handle
-  comments, multi-line variable declarations and multiple initializers.
-  (Dale Anson)
+- Fix high memory usage for large search&replace all operations.
+  (Patch #3531515 by Thomas Meyer)
 
-- Soft wrap now works at non-whitespace line breaks within some natural
-  language texts; Japanese for example.
-  (patch #2483695 Kazutoshi Satoda)
+- Fix memory usage of Buffer.calculateHash() (patch# 3560429, Thomas Meyer)
 
-- Introduced glyph caching to lower CPU usage on text rendering and
-  line wrapping. (Kazutoshi Satoda)
+- Make_Bug_Report macro now use logs edit mode to have a little coloring
+  in the result (Matthieu Casanova)
 
-- Changed calculation of wrap margin to be based on an average character
-  width instead of a width of a space which gave very narrow wrap margin
-  for proportional fonts. (Kazutoshi Satoda)
+- Beep on output option in Activity log settings
+  (request #3551931 Jarek Czekalski)
 
-- Updated Move Lines Up and Down macros to move whole lines regardless of
-  selection. (Dale Anson)
+- New Plugin Manager option: Disable obsolete plugins (#2931321 Alan Ezust)
 
 }}}
 
diff --git a/doc/FAQ/faq-macros.xml b/doc/FAQ/faq-macros.xml
index 8269491..7a3f82f 100644
--- a/doc/FAQ/faq-macros.xml
+++ b/doc/FAQ/faq-macros.xml
@@ -14,7 +14,7 @@
 
             <qandaentry>
                 <question id="macro-getting">
-                    <para>Where can I get macro's from?</para>
+                    <para>Where can I get macros from?</para>
                 </question>
 
                 <answer>
@@ -22,7 +22,7 @@
                     will provide a similar interface to jEdit's plugin manager
                     for installing new macros. The plugin downloads the macros
                     from the jEdit Community site, so an internet connection is
-                    necessary. It needs to be updated for jEdit 4.4. </para>
+                    necessary. </para>
                 </answer>
             </qandaentry>
 
diff --git a/doc/FAQ/faq-plugins.xml b/doc/FAQ/faq-plugins.xml
index c593fe5..8f7b6ea 100644
--- a/doc/FAQ/faq-plugins.xml
+++ b/doc/FAQ/faq-plugins.xml
@@ -99,32 +99,40 @@
                 <question id="plugin-cvs">
                     <para>Can I work with cvs/svn/git/hg/bzr/Perforce
                     under jEdit? Is there a plugin for my favorite SCCS system?
-                    How can I send a command from jEdit to cvs/svn without
-                    leaving my editor?</para>
+                    How can I send a command and edit a commit message from jEdit to svn/git without leaving my editor?</para>
                 </question>
                 <answer>
+
+
+                    <para>When using command line tools, the Console plugin
+                    documentation has some ideas on how to set your environment so that jEdit is the
+                    <literal>VISUAL</literal> and <literal>EDITOR</literal>
+                    used by <literal>svn</literal> or <literal>git</literal>
+                    when editing a commit message, for example. </para>
+
                     <para>The SVNPlugin supports Subversion browsing, diffing
                     (via JDiff) and other common operations.</para>
-                    <para>With *NIX (or cygwin), the Console plugin
-                    documentation has some ideas on how to set jEdit as the
-                    <literal>VISUAL</literal> and <literal>EDITOR</literal> tool  when called from the
-                    cvs/svn/hg command-line tools, all of which can be run from
-                    the Console dockable.</para>
+
                     <para>The ProjectViewer plugin has some support for reading
                     the "entries" in your working directory, and will use that
                     as a filter for importing. CVS support is built-in, and
-                    subversion, p4, bzr, git, and hg are supported via plugins.
+                    svn, p4, bzr, git, and hg are supported via plugins.
                     </para>
-                    <para>The P4Plugin and SvnPlugin both add extensions to the
-                    ProjectViewer tree, and have some other features for
+
+                    <para>The <literal>P4Plugin</literal>, <literal>GitPlugin</literal>,
+                    and <literal>SvnPlugin</literal> add extensions to the
+                    ProjectViewer tree, and offer additional operations for
                     working with repositories.</para>
-                    <para><literal>SourceControl</literal> plugin has some
-                    features to work with Microsoft Visual SourceSafe.
-                    </para>
-                    <para> <literal>ClearCasePlugin</literal> is used with Rational ClearCase. </para>
+
+                    <para><literal>SourceControl</literal> plugin offers
+                    support for Microsoft Visual SourceSafe. </para>
+
+                    <para> The <literal>ClearCasePlugin</literal> can be used with Rational ClearCase. </para>
+
                     <para>You can use jEdit as your default editor from WinCVS:
                     specify <userinput>jedit.exe</userinput> as your default
                     viewer and editor to automate the opening of file.</para>
+
                     <para>GruntSpud and jEditCvs plugins are no longer supported. </para>
                 </answer>
             </qandaentry>
@@ -167,9 +175,7 @@
                     <para>The FTP plugin allows remote editing of files over the
                     <literal>SFTP://</literal> and <literal>FTP://</literal>
                     protocols. <literal>HTTP://</literal> is supported natively
-                    in jEdit. The <literal>FTPS://</literal> and
-                    <literal>FISH://</literal> protocols are not supported
-                    yet.</para>
+                    in jEdit. </para>
                 </answer>
             </qandaentry>
         </qandadiv>
diff --git a/doc/FAQ/faq-use.xml b/doc/FAQ/faq-use.xml
index 8002e63..0707509 100644
--- a/doc/FAQ/faq-use.xml
+++ b/doc/FAQ/faq-use.xml
@@ -47,9 +47,7 @@
                 </question>
 
                 <answer>
-                    <para>Select
-                    <guimenu>Utilities</guimenu>><guimenuitem>Global
-                    Options</guimenuitem>, then select the
+                    <para>Select<guimenuitem>Global Options</guimenuitem>,
                     <guimenuitem>Abbreviations</guimenuitem> option pane. You
                     will see a checkbox option for <quote>Space bar expands
                     abbrevs</quote>. Here you can also add, modify and delete
@@ -126,10 +124,8 @@
                     the original file on the server.</para>
 
                     <para>To avoid this problem, you can disable the two-step
-                    file saving routine. Select
-                    <guimenu>Utilities</guimenu>><guimenuitem>Global
-                    Options</guimenuitem>, then under <guimenuitem>Loading &
-                    Saving</guimenuitem>, clear the checkbox for
+                    file saving routine. Select <guimenuitem>Global Options</guimenuitem>, 
+                    then under <guimenuitem>Saving & Backup</guimenuitem>, clear the checkbox for
                     <guimenuitem>Two-stage save</guimenuitem>.</para>
                 </answer>
             </qandaentry>
@@ -155,19 +151,17 @@
                 </question>
 
                 <answer>
-                    <para>Only Unicode can be detected when a file is loaded.
-                    For other encodings, you must specify the encoding when the
-                    file is loaded if you do not wish to use the default
-                    encoding for your operating system.</para>
-
-                    <para>There are a few features that can help you navigate
-                    through encoding issues. You can select the encoding you
+                    
+                    <para> You can select the encoding you
                     wish to use from <guisubmenu> Encoding</guisubmenu> in the
                     <guimenu>Commands</guimenu> menu of the File System Browser.
                     You can also designate a default encoding in the
-                    <guimenuitem>Loading & Saving</guimenuitem> pane of the
-                    Global Options dialog; if you do not, jEdit adopts your
-                    operating system's default encoding as its own default. You
+                    <ulink url="jeditresource:/doc/users-guide/global-opts.html#encodings-pane">
+                    <guimenuitem>Encoding</guimenuitem></ulink> pane of the
+                    Global Options; if you do not, jEdit uses
+                    
+                    <emphasis role="bold">encoding autodetectors</emphasis> to decide which encoding
+                    to open a file in. You
                     can change the encoding used to save an individual file by
                     selecting
                     <guimenu>Utilities</guimenu>><guimenuitem>Buffer
@@ -344,9 +338,8 @@
                 </question>
 
                 <answer>
-                    <para><guimenuitem>Select Utilities>Global
-                    Options</guimenuitem>, and in the
-                    <guimenuitem>Gutter</guimenuitem> option pane select the
+                    <para>Select <guimenuitem>Global Options</guimenuitem>, 
+                    <guimenuitem>Gutter</guimenuitem> option pane, and check the
                     <guimenuitem>Line Numbering</guimenuitem> check box.</para>
                 </answer>
             </qandaentry>
@@ -367,7 +360,7 @@
                     processors do. This would require a BeanShell macro to
                     modify quoted text.</para>
 
-                    <para>The Accents and CharacterMap plugins can also help you
+                    <para>The built-in Abbreviations feature (<guimenu>Global Options</guimenu> <guimenuitem>Abbreviations</guimenuitem>) as well as the Accents and CharacterMap plugins can also help you
                     type international characters.</para>
 
                     <para>You also have the option of using a TeX macro (or, in
@@ -380,32 +373,6 @@
             </qandaentry>
 
             <qandaentry>
-                <question id="text-softwrap">
-                    <para>Does jEdit have a <quote>soft</quote> wrap text
-                    mode?</para>
-                </question>
-
-                <answer>
-                    <para>jEdit's 4.3's soft wrap mode, and especially its wrap
-                    to margin=0, is one of its many features that just works
-                    better than it does in most other editing environments. Soft
-                    Wrap with margin=0 was unavailable in jEdit 4.2, but users
-                    of 4.1 will remember it well. When you set SOFT WRAP with a
-                    margin=0, you don't need to use the horizontal scroller
-                    anymore. It's just as simple as that.</para>
-
-                    <para>jEdit wrap capability can be activated for a specific
-                    buffer, specific editing modes, or for all documents by
-                    default. In prior versions, both the text wrap feature and
-                    the <guimenuitem>Edit>Text>Format
-                    Paragraph</guimenuitem> command insert <quote>hard</quote>
-                    end of line characters. This <quote>hard wrap</quote>
-                    feature remains available as an option for buffers and
-                    editing modes.</para>
-                </answer>
-            </qandaentry>
-
-            <qandaentry>
                 <question id="text-display-spaces">
                     <para>The display of spaces as a character in the editor is
                     annoying. How can I disable those small square boxes?</para>
@@ -414,10 +381,8 @@
                 <answer>
                     <para>This is controlled by the WhiteSpace plugin. To change
                     your settings to disable display of whitespace characters,
-                    select <guimenuitem>Utilities>Global
-                    Options</guimenuitem>, then select <guimenuitem>Plugin
-                    options>WhiteSpace</guimenuitem>. You can separately
-                    configure the display of spaces, tabs, and other whitespace
+                    <guimenuitem>Plugin options>WhiteSpace</guimenuitem>. 
+                    You can separately configure the display of spaces, tabs, and other whitespace
                     characters.</para>
                 </answer>
             </qandaentry>
@@ -432,21 +397,12 @@
                     available encoding scheme, and can open files with a
                     specified encoding other than the default encoding of your
                     operating system using the
-                    <guimenu>Commands</guimenu>><guisubmenu>Encoding
-                    </guisubmenu> from the File System Browser.</para>
+                    <guimenu>File</guimenu>><guisubmenu>Reload with Encoding
+                    </guisubmenu> action.</para>
 
                     <para>With respect to menu labels, message strings and other
-                    GUI elements, the jEdit project team currently does not have
-                    the resources to maintain multiple property sets in
-                    languages other than English, particularly since the
-                    development effort is continuing at a rapid pace. There has
-                    not been great demand for this in any event. This may be
-                    because jEdit is primarily a tool for programmers, and the
-                    use of English as a common first or second language is
-                    widespread in the global programming community. This
-                    decision may be reconsidered when the application has
-                    further matured and if more individuals express a
-                    willingness to be involved in translation work.</para>
+                    GUI elements, the jEdit project team now supports localization files for different languages.
+                    How well they are maintained is up to the individual members of the community who help to maintain them. </para>
                 </answer>
             </qandaentry>
         </qandadiv>
@@ -540,49 +496,19 @@
         <qandadiv id="emacs-tricks">
             <title>Tips for Emacs users</title>
 
-            <para>For more emacs help, check out <ulink
-            url="http://www.clapper.org/software/jedit/">this site</ulink> for
-            more emacs macros.</para>
-
-            <qandaentry>
-                <question id="settings-emacstab">
-                    <para>Can I have an emacs style tab key (tab anywhere in a
-                    line re-indents it)?</para>
-                </question>
-
-                <answer>
-                    <para>Yes. You can do this by rebinding the
-                    <keycode>tab</keycode> key to <command>Indent Selected
-                    Lines</command> in the <guimenuitem>Global
-                    Options</guimenuitem>.</para>
-                </answer>
-            </qandaentry>
-
             <qandaentry>
                 <question id="settings-emacsctrle">
-                    <para>How do I map Ctrl-E to go to the end of the
-                    line?</para>
+                    <para>How do I get Emacs-like key bindings out of the box? </para>
                 </question>
 
                 <answer>
-                    <para>Start with a keymap that does not contain any
-                    multiple-key shortcuts beginning with Ctrl-E, such as the
-                    "Emacs" Keymap which binds Ctrl-E
-                    to "smart end", and customize it by setting your own shortcuts to make it more like your flavor of emacs.
+                    <para>Start with the "Emacs" Keymap and customize it by setting 
+                    your own shortcuts to make it more like your flavor of Emacs.
+                    Emacs macros are contributed by Brian Clapper. 
                     </para>
                 </answer>
             </qandaentry>
 
-            <qandaentry>
-                <question id="emacs-ctrl-k">
-                    <para>What about ctrl-K?</para>
-                </question>
-
-                <answer>
-                    <para>Check out <literal>macros/Editing/Emacs_Ctrl_K.bsh</literal>.
-                    Bind it to Ctrl-k from the shortcuts option pane.</para>
-                </answer>
-            </qandaentry>
         </qandadiv>
 
         <qandadiv id="customize-other">
@@ -595,12 +521,10 @@
                 </question>
 
                 <answer>
-                    <para>Select
-                    <guimenu>Utilities</guimenu>><guimenuitem>Global
-                    Options</guimenuitem>, then the
-                    <guimenuitem>Appearance</guimenuitem> option pane. When you
-                    select the <quote>Metal</quote> look and feel you can also
-                    select the fonts used for various displayed items.</para>
+		<para>Select the <guimenuitem>Global Options</guimenuitem>, 
+		<guimenuitem>Appearance</guimenuitem> option pane. When you
+		select the <quote>Metal</quote> look and feel you can also
+		select the fonts used for various displayed items.</para>
                 </answer>
             </qandaentry>
             <qandaentry>
@@ -608,14 +532,21 @@
                     <para>How can I get antialiased text everywhere, even dockables and menus? </para>
                 </question>
                 <answer>
-                   <para>For the text area, go to <guimenuitem>Global Options - TextArea - Anti Aliased Smooth Text</guimenuitem>. </para>
+                   <para>For the text area, go to <guimenuitem>Global Options - TextArea - Anti Aliased Smooth Text</guimenuitem>.
+                   Note that enabling the related option for "Fractional font metrics" potentially
+                   improves character shapes, but can make the text look blurry. </para>
+                   
                    <para>For the dockables, starting <command>java</command> with command line options <literal>"-Dawt.useSystemAAFontSettings=on" "-Dswing.aatext=true"</literal> will give you antialiased text everywhere else.
                    You can add these options to the batch file or shell script line that starts jEdit. </para>
+                   
                    <para> On Windows with the .exe launcher, you create a file called <literal>jedit.l4j.ini</literal> in the same directory as the .exe file, 
                    and place one line for each java argument you want to pass. For example:
                    <programlisting>-Dawt.useSystemAAFontSettings=on
 -Dswing.aatext=true</programlisting>
                    </para>
+                   
+                   <para> On Mac OS X, the jEdit.app bundle already provides certain antialiasing properties in
+                   <literal>Contents/Info.plist</literal> to enable that by default.</para>
 			    </answer>
             </qandaentry>
             <qandaentry>
diff --git a/doc/FAQ/faq.xml b/doc/FAQ/faq.xml
index 12a4b51..b79c900 100644
--- a/doc/FAQ/faq.xml
+++ b/doc/FAQ/faq.xml
@@ -85,10 +85,10 @@
             </revision>
 
             <revision>
-                <revnumber>1.3</revnumber>
-                <date>2006,2011</date>
+                <revnumber>1.4</revnumber>
+                <date>2006,2012</date>
                 <author> <firstname>Alan </firstname> <surname>Ezust </surname></author>
-                <revremark>Updates for jEdit 4.3-5.0 releases</revremark>
+                <revremark>Updates for jEdit 4.3-5.1 releases</revremark>
             </revision>
         </revhistory>
 
diff --git a/doc/releasing-jedit.txt b/doc/releasing-jedit.txt
index 98489fd..87aadaf 100644
--- a/doc/releasing-jedit.txt
+++ b/doc/releasing-jedit.txt
@@ -109,8 +109,10 @@ Workflow
     - Open sftp://[sourceForgeUsername],jedit at web.sourceforge.net/home/project-web/jedit/htdocs/devel.html e. g. in jEdit with installed FTP plugin and add a line for [version] in the Release Schedule
 
 10. Update the plugin wizard
-     - Go to http://plugins.jedit.org/wiz/release_add.php?package_id=24
-     - Enter the Version "[version]"
+     - Go to http://plugins.jedit.org/wiz/release_list.php?package_id=24
+     - Find or create the entry for this jEdit Release
+          The entry may already exist but have an invalid date 
+          if a plugin was released that depends on it. 
      - Switch "Head of Branch" to "[ifdevel]devel[/ifdevel][iffinal]main[/iffinal]"
      - Check the "Remove" checkbox for the jEdit dependency
      - Switch the "Low Version" of the JDK dependency to "1.6 [jdk-1.6]"
@@ -164,6 +166,15 @@ Thanks to  for contributing to this release.
             svn commit -m "Update the version number to [nextVersion]"
        in the root source directory
 
+16. It the release is from the latest release branch, clean up doc/CHANGES.txt on trunk.
+     - Update the version number which is the base of CHANGES.txt.
+       "changes since jEdit [version]".
+     - Remove all entries which has been released in [version].
+       The entries to be removed are those which are listed in CHANGES in the release you just finished.
+     - Submit your changes by doing
+            svn commit -m "Update the base version of CHANGES.txt to [version]" doc/CHANGES.txt
+       in trunk.
+
 ====================================================================================================
 import java.util.regex.Pattern;
 file = new File(new File(buffer.getPath()).getParentFile(), "../org/gjt/sp/jedit/jEdit.java");
diff --git a/doc/tips/tip1.html b/doc/tips/tip1.html
index 7891a6b..ac51e45 100644
--- a/doc/tips/tip1.html
+++ b/doc/tips/tip1.html
@@ -1,2 +1 @@
-<html><body>You can press <b>C+e C+v</b> to display a dialog box listing
-the 20 most recently copied and pasted strings.</body></html>
+<html><body>You can invoke the "Paste Previous" action (<b>C+e C+v</b>) to display a dialog box listing the 20 most recently copied and pasted strings.</body></html>
diff --git a/doc/tips/tip14.html b/doc/tips/tip14.html
index 7c00610..67ab02f 100644
--- a/doc/tips/tip14.html
+++ b/doc/tips/tip14.html
@@ -1,2 +1 @@
-<html><body>You can press <b>C+`</b> to switch between the two most
-recently edited buffers.</body></html>
+<html><body>You can press <b>C+`</b> to invoke the <b>View</b> - <b>Go To Recent Buffer</b> action, which will switch between the two most recently edited buffers.</body></html>
diff --git a/doc/tips/tip16.html b/doc/tips/tip16.html
index e7bb141..a7457a5 100644
--- a/doc/tips/tip16.html
+++ b/doc/tips/tip16.html
@@ -1,9 +1 @@
-<html><body>You can press <b>C+t <i>X</i></b> to save the current
-position to a marker with shortcut <i>X</i>, and <b>C+y <i>X</i></b> to return
-to the marker with shortcut <i>X</i>, where <i>X</i> is any key on your
-keyboard.<p>
-
-Marker positions are saved to <tt>.<i>file
-name</i>.marks</tt>. If you don't these files to be created,
-disable marker persistence in the <b>General</b> pane of
-the <b>Utilities</b>><b>Global Options</b> dialog box.</body></html>
+<html><body>The built-in markers feature of jEdit is not very good compared to the MarkerSets plugin, which provides a replacement for most of the Markers menu actions. For those actions that are missing from MarkerSets, the Navigator plugin provides the rest. </body></html>
diff --git a/doc/tips/tip2.html b/doc/tips/tip2.html
index 282a99b..b1376f8 100644
--- a/doc/tips/tip2.html
+++ b/doc/tips/tip2.html
@@ -1,8 +1,8 @@
-<html><body>Pressing <b>C+b</b> searches the current
-buffer and the current mode's keyword list for words beginning with
+<html><body>Pressing <b>C+b</b> invokes the <guimenuitem>Complete Word</guimenuitem>
+action. This action searches the current buffer and the current mode's keyword list for words beginning with
 the one before the caret.<p>
 
-This serves as a very basic code completion feature, for example:
+<p> This serves as a very basic code completion feature, for example: </p>
 
 <ul>
 <li>When editing any kind of program source, enter the first few characters of
diff --git a/doc/tips/tip22.html b/doc/tips/tip22.html
index 7278fc8..7fd6fbc 100644
--- a/doc/tips/tip22.html
+++ b/doc/tips/tip22.html
@@ -1,4 +1,8 @@
-<html><body>jEdit's register feature is a powerful extension of the clipboard
-metaphor. <b>C+r C+c <i>X</i></b> copies the selected text to register
+<html><body>
+<p> jEdit's register feature is a powerful extension of the clipboard
+metaphor. From the <b>Edit - More Clipboard</b> submenu, you can see the
+cut/copy/append/paste register actions. <b>C+r C+c <i>X</i></b> copies the selected text to register
 <i>X</i>. <b>C+r C+v <i>X</i></b> inserts the contents of register
-<i>X</i> into the buffer. Register contents are persistent between editing sessions.</body></html>
+<i>X</i> into the buffer. Register contents are persistent between editing sessions. </p>
+<p> You can see the contents of all registers in a dockable by invoking <b>View Registers</b>. </p>
+</body></html>
diff --git a/doc/tips/tip26.html b/doc/tips/tip26.html
index ce8b390..5c3db68 100644
--- a/doc/tips/tip26.html
+++ b/doc/tips/tip26.html
@@ -1,2 +1,5 @@
-<html><body>The jEdit user's guide includes a keyboard shortcut
-quick reference. Print it out; it's very handy.</body></html>
+<html><body>
+<p> <b>Macros - Misc - Display Shortcuts</b> shows you 
+a table of the current shorcuts. From there, you can 
+dump it to a buffer and print it, giving you a cheat-sheet. </p>
+</body>
diff --git a/doc/tips/tip3.html b/doc/tips/tip3.html
index c1db95c..5172c16 100644
--- a/doc/tips/tip3.html
+++ b/doc/tips/tip3.html
@@ -1,2 +1,2 @@
 <html><body>jEdit can be customized to suit your tastes in the
-<b>Utilities</b>><b>Global Options</b> dialog box.</body></html>
+<b>Utilities</b>><b>Options</b> dialog box.</body></html>
diff --git a/doc/tips/tip32.html b/doc/tips/tip32.html
index 7c70880..637e0b2 100644
--- a/doc/tips/tip32.html
+++ b/doc/tips/tip32.html
@@ -1,6 +1,4 @@
 <html><body>
-You can define up to two distinct keyboard shortcuts for each command
-in the <b>Shortcuts</b> pane of the
-<b>Utilities</b>><b>Global Options</b>
-dialog box.
+You can define up to two distinct keyboard shortcuts for each command in the <b>Shortcuts</b> option pane of the
+<b>Global Options</b> dialog box.
 </body></html>
diff --git a/doc/tips/tip34.html b/doc/tips/tip34.html
index d629842..c8f7dd8 100644
--- a/doc/tips/tip34.html
+++ b/doc/tips/tip34.html
@@ -1,19 +1,20 @@
 <html><body>
-
+<p>
 You can replace all occurrences of a specific string or regular
 expression with the return value of a BeanShell script if the
 <b>Return value of a BeanShell
 snippet</b> radio button is selected in the search dialog box.<p>
-
+</p>
+<p>
 You can use
 this, for example, to convert all tags in an HTML file to lower case, by
 searching for the following regular expression:
+</p>
 
 <p>
 <code><(.+?)></code>
 
 <p>
-
 And entering the following in the replace text field:
 
 <p>
diff --git a/doc/tips/tip43.html b/doc/tips/tip43.html
index 3a49fde..17abf85 100644
--- a/doc/tips/tip43.html
+++ b/doc/tips/tip43.html
@@ -1,2 +1 @@
-<html><body>Font smoothing can be enabled in the <b>Text Area</b> pane of the
-<b>Utilities</b>><b>Global Options</b> dialog box.</body></html>
+<html><body>Font smoothing can be enabled in the <b>Text Area</b> pane of <b>Global Options</b>. </body></html>
diff --git a/doc/tips/tip66.html b/doc/tips/tip66.html
index be84870..98eb044 100644
--- a/doc/tips/tip66.html
+++ b/doc/tips/tip66.html
@@ -1,2 +1,3 @@
 <html><body>Just like most Unix shells, jEdit interprets a tilde ("~") at the
-start of a path name as being the location of your home directory.</body></html>
+start of a path name as being the location of your home directory. In addition, jEdit expands variables from most places that accept a filename as an input.
+</body></html>
diff --git a/doc/tips/tip81.html b/doc/tips/tip81.html
index 5167b3a..9f47c84 100644
--- a/doc/tips/tip81.html
+++ b/doc/tips/tip81.html
@@ -1,6 +1,7 @@
 <html><body>
-Before getting back to work, cook yourself up a delicious meal from the
-official jEdit cookbook:<p>
-
-<font color="blue">http://www.rutherfurd.net/cookbook/</font>
+<p> Be sure to check for plugin updates from time to time
+from the <b>Plugin Manager - Update</b> tab. 
+To keep jEdit up to date, you can use the Updater plugin which can 
+download and install daily builds. 
+</p>
 </body></html>
diff --git a/doc/tips/tip88.html b/doc/tips/tip88.html
index d52cf90..c62c982 100644
--- a/doc/tips/tip88.html
+++ b/doc/tips/tip88.html
@@ -1,2 +1,9 @@
-<html><body>Pressing <b>C+e C+j</b> moves keyboard focus to the text area.
+<html><body>There are a number of actions that will bring keyboard focus back to the text
+area:
+<ul>
+<li> <b>Go to text area</b> </li>
+<li> <b>Center caret on Screen</b> </li>
+<li> <b>Scroll to Current Line</b></li>
+<li> <b>Scroll and Center Caret</b> (Ctrl+L in most keymaps). </li>
+</ul>
 </body></html>
diff --git a/doc/users-guide/activity-log.xml b/doc/users-guide/activity-log.xml
index 5edbce0..7629bd9 100644
--- a/doc/users-guide/activity-log.xml
+++ b/doc/users-guide/activity-log.xml
@@ -52,10 +52,20 @@
     automatically updated on disk when jEdit exits.</para>
 
     <para>
-    The "Settings" button in the Activity Log window shows a dialog that lets
+    The <guibutton>Settings</guibutton> button in the Activity Log window
+    shows a dialog that lets
     you adjust the output colors, filter the messages by type, and lets you set
     the maximum number of lines to display.  Note that larger numbers will 
     decrease the overall performance of jEdit since these lines are kept in
     memory.
     </para>
+
+    <para>In the <guibutton>Settings</guibutton> pane there is also
+    a debugging option, <guibutton>Beep on output</guibutton>.
+    It allows for catching problems right after they show up.
+    Each error message entry is accompanied by a system beep.
+    Lower priority entries may be alerted this way, if the
+    <userinput>log</userinput> option is used, 
+    see <xref linkend="cli-usage" />.
+    </para>
 </appendix>
\ No newline at end of file
diff --git a/doc/users-guide/basics.xml b/doc/users-guide/basics.xml
index 600cd19..17d1a60 100644
--- a/doc/users-guide/basics.xml
+++ b/doc/users-guide/basics.xml
@@ -228,7 +228,7 @@
 
         <para> The <guimenu> File </guimenu> > <guimenuitem>Close (global)</guimenuitem> action closes the buffer in all EditPanes, as the jEdit 4.2 <guimenu> File </guimenu> > <guimenuitem>Close</guimenuitem> action did before. </para>
 
-        <para> When <guimenuitem>Exclusive Buffersets</guimenuitem> are enabled, any time a buffer is opened from one EditPane, it should be automatically closed in other EditPanes which use a disjoint (non-intersecting) BufferSet. </para>
+        <para> When <guimenuitem>Exclusive Buffersets</guimenuitem> are enabled, any time a buffer is visited in one EditPane, it should be automatically closed in other EditPanes which use a disjoint (non-intersecting) BufferSet. </para>
 
         <para> <guimenuitem>Close Others</guimenuitem> will clear the BufferSet of the
         current EditPane by performing a <guimenuitem>Close</guimenuitem> on all items except those buffers which are displayed in another active EditPane. </para>
@@ -242,7 +242,7 @@
         The BufferSet Scope can also be changed from
         <guimenu>View</guimenu>><guimenu>Buffer Sets</guimenu>  >
         <guimenu>(Global|View|EditPane) Buffer Set</guimenu>.
-        Changes to the bufferset scope affects all editpanes immediately.
+        A change to the bufferset scope affects all editpanes immediately.
         </para>
 
     </section>
diff --git a/doc/users-guide/customizing.xml b/doc/users-guide/customizing.xml
index 8fa8a08..a1b5162 100644
--- a/doc/users-guide/customizing.xml
+++ b/doc/users-guide/customizing.xml
@@ -213,7 +213,7 @@
         as it is a buffer-local property and specifying the character encoding
         for the file. But it is not really a buffer-local property, and behaves
         differently.
-        It is detected by <literal>buffer-local-properties</literal> detector
+        It is detected by <literal>buffer-local-property</literal> detector
         only if the detector is selected in encoding options. Thus, it works
         only at loading, and it must appear near the top of the file.
         See <xref linkend="encodings"/>. </para>
@@ -457,6 +457,21 @@
             chooser for the desired download mirror, as well as various settings
             such as the directory where plugins are to be installed. In addition, you can set the time in minutes that the pluginlist can be cached from jedit.org, helping to reduce the server load. See <xref
             linkend="using-plugins" />.</para>
+            
+            <para> If the option "disable obsolete plugins" is enabled, then plugins
+            that were released on Plugin Manager will be checked against the plugins you have
+            installed, for those with a maximum jEdit version that is lower than the one you are 
+            running. Plugins are marked with a maximum version when they are found to be broken or somehow
+            incompatible with a given jEdit release. 
+            Until an update is made available for such a plugin
+            on Plugin Manager, these plugins are automatically unloaded and marked unsupported. </para>
+            
+            <para> If you re-enable a plugin that was disabled this way, it will remain loaded until the
+            next time the plugin list checked - whenever the user
+            selects the Update or Install tab from Plugin Manager. If you un-check this option,
+            then obsolete plugins will not be automatically disabled in this way. </para>
+            
+            
         </section>
 
         
diff --git a/doc/users-guide/files.xml b/doc/users-guide/files.xml
index e2857a9..954d1bf 100644
--- a/doc/users-guide/files.xml
+++ b/doc/users-guide/files.xml
@@ -320,7 +320,7 @@
                 a file.</para>
                 <programlisting># -*- coding: utf-8 -*-                </programlisting>
             </listitem>
-            <listitem> <para> <emphasis role="bold">buffer-local-properties</emphasis>:
+            <listitem> <para> <emphasis role="bold">buffer-local-property</emphasis>:
                 Enable buffer-local properties' syntax
                 (see <xref linkend="buffer-local" />)
                 at the top of the file to specify encoding. </para>
@@ -618,32 +618,20 @@
     </section>
 
     <section id="threaded-io">
-        <title>Multi-Threaded I/O</title>
+        <title>I/O tasks</title>
 
         <para>To improve responsiveness and perceived performance, jEdit
-        executes all buffer input/output operations asynchronously. While I/O is
-        in progress, the status bar displays the number of remaining I/O
-        operations.</para>
+        executes all buffer input/output tasks asynchronously.
+        When a task such as this is in progress, the status bar displays the number of running tasks. </para>
 
         <para>The
         <guimenu>Utilities</guimenu>><guisubmenu>Troubleshooting</guisubmenu>>
         <guimenuitem>Task Monitor</guimenuitem> command displays a window with more
-        detailed status information and progress meters. By default, the
+        detailed status information and progress meters for each task. By default, the
         <guimenuitem>Task Monitor</guimenuitem> is shown in a floating
         window. This window can be docked using the commands in its top-left
-        corner popup menu; see <xref linkend="docking" />. I/O requests can also
-        be aborted in this window, however note that aborting a buffer save can
-        result in data loss.</para>
-
-        <!-- <para>
-   By default, four I/O threads are created, which means that up
-   to four buffers can be loaded or saved simultaneously. The number of
-   threads can be changed in the
-   <guibutton>Loading and Saving</guibutton> pane of the
-   <guimenu>Utilities</guimenu>><guimenuitem>Options</guimenuitem>
-   dialog box; see <xref linkend="global-opts" />. Setting the number to zero
-   disables multi-threaded I/O completely; doing this is not recommended.
-  </para> -->
+        corner popup menu; see <xref linkend="docking" />. Tasks can be aborted in this window, however note that aborting a buffer save can result in data loss.</para>
+
     </section>
 
     <section id="printing">
diff --git a/doc/users-guide/macro-basics.xml b/doc/users-guide/macro-basics.xml
index 5de7dab..28292e2 100644
--- a/doc/users-guide/macro-basics.xml
+++ b/doc/users-guide/macro-basics.xml
@@ -374,11 +374,6 @@ org.gjt.sp.util</programlisting>
                 <para><varname>scriptPath</varname> - set to the full path of
                 the script currently being executed.</para>
             </listitem>
-
-            <listitem>
-                <para><varname>scriptPath</varname> - set to the full path of
-                the script currently being executed.</para>
-            </listitem>
         </itemizedlist>
 
         <para>Note that these variables are set at the beginning of macro
diff --git a/doc/users-guide/macro-index.xml b/doc/users-guide/macro-index.xml
index 52171d0..4598215 100644
--- a/doc/users-guide/macro-index.xml
+++ b/doc/users-guide/macro-index.xml
@@ -340,7 +340,19 @@
                 <para><filename>Open_Selection.bsh</filename></para>
 
                 <para>Opens the file named by the current buffer's selected
-                text.</para>
+                text. Current VFS browser directory is also tried as
+                a parent of the filename, but only as a local path.</para>
+            </listitem>
+
+            <listitem>
+                <para><filename>Open_Selection_In_Desktop.bsh</filename></para>
+
+                <para>Opens the file named by the current buffer's selected
+                text using <code>Desktop</code>. That is opens the file
+                using operating system's default application.
+                If a link is selected, it is browsed instead, using default
+                web browser. If no selection is active, the path
+                under caret is used.</para>
             </listitem>
 
             <listitem>
diff --git a/doc/users-guide/source-edit.xml b/doc/users-guide/source-edit.xml
index b11f8d6..690ca7e 100644
--- a/doc/users-guide/source-edit.xml
+++ b/doc/users-guide/source-edit.xml
@@ -268,7 +268,7 @@
 
                 <section id="electric-keys">
                 <title>Electric keys</title>
-                
+
                 <para>
                 Electric keys cause reapplying of the indentation rules to
                 the current line. Thanks to the electric keys the following
@@ -403,6 +403,14 @@
         <keycap>C+e C+k</keycap>) inserts the line comment string, for example
         <literal>//</literal> in Java mode, at the start of each selected
         line.</para>
+
+        <tip> <title> Toggling Comments </title>
+        <para> You might be looking for the actions
+        <guimenuitem>Toggle Line Comment</guimenuitem> or
+        <guimenuitem>Toggle Range Comment</guimenuitem>.
+        They are available from the TextTools plugin, not jEdit core. </para>
+        </tip>
+
     </section>
 
     <section id="bracket-matching">
diff --git a/doc/users-guide/text-edit.xml b/doc/users-guide/text-edit.xml
index e1df0d1..bf1c78b 100644
--- a/doc/users-guide/text-edit.xml
+++ b/doc/users-guide/text-edit.xml
@@ -838,6 +838,18 @@
     <section id="markers">
         <title>Markers</title>
 
+       <tip> <title> MarkerSets </title>
+        <para> The MarkerSets plugin is a replacement for the
+        built-in Markers feature of jEdit. Markers saved with
+        MarkerSets properly update when lines are added or
+        removed from a buffer. Furthermore, you can see
+        markers from multiple files in the Marker Sets
+        dockable. We recommend you use that instead
+        of the built-in Markers.
+        </para>
+        </tip>
+
+
         <para>A <firstterm>marker</firstterm> is a pointer to a specific
         location within a buffer, which may or may not have a single-character
         <firstterm>shortcut</firstterm> associated with it. Markers are
@@ -906,6 +918,8 @@
         highlight. Moving the mouse over the highlight displays a tool tip
         showing the marker's shortcut, if it has one. See <xref
         linkend="overview" /> for information about the gutter.</para>
+
+
     </section>
 
     <section id="search-replace">
diff --git a/doc/users-guide/users-guide.xml b/doc/users-guide/users-guide.xml
index 95e55ce..9b9f565 100644
--- a/doc/users-guide/users-guide.xml
+++ b/doc/users-guide/users-guide.xml
@@ -5,7 +5,7 @@
 <book id="users-guide"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude"  xsi:noNamespaceSchemaLocation='http://www.docbook.org/xsd/4.4/docbook.xsd'>
     <bookinfo>
-        <title>jEdit 5.0 User's Guide</title>
+        <title>jEdit 5.1 User's Guide</title>
 
         <legalnotice>
             <title>Legal Notice</title>
@@ -39,8 +39,8 @@
                </revision>
             
             <revision>
-              <revnumber>4.3 - 5.0</revnumber>
-              <date>2005-2012</date>
+              <revnumber>4.3 - 5.2</revnumber>
+              <date>2005-2013</date>
               <author><firstname>Alan</firstname><surname>Ezust</surname></author>
               <revremark> Maintainer. </revremark>
             </revision>
diff --git a/doc/users-guide/writing-modes.xml b/doc/users-guide/writing-modes.xml
index 80649c1..8d8495a 100644
--- a/doc/users-guide/writing-modes.xml
+++ b/doc/users-guide/writing-modes.xml
@@ -42,7 +42,25 @@
         <literal><TAG /></literal> may be used. An example of this
         shorthand can be seen in the <literal><PROPERTY></literal> tags
         above.</para>
-        <para>XML is case sensitive. <literal>Span</literal> or
+
+<tip><title> Validation and Errors </title>
+
+<para> Most XML file formats have a formal grammar specified in either DTD, XSD or RNG.
+In the example above, we can see that the <literal>DOCTYPE</literal>,
+or formal grammar for jEdit mode files is described in <literal>xmode.dtd</literal>,
+which happens to come from jEdit's source code.
+If you install the XML plugin, and while editing a mode file in jEdit, go to
+<guimenuitem>Plugins - XML - Parse as XML</guimenuitem>,
+you should see a structure tree in Sidekick,
+and you will also see errors (if there are any) in ErrorList, if the document does not
+conform to the proper XML syntax or the document's formal grammar.
+In addition, the XML plugin provides completion tips for elements and attributes.
+All of these things can help immensely especially when learning XML.
+</para>
+<para> It is highly recommended that you check your XML files for validation errors
+before submitting them to the community. </para></tip>
+
+         <para>XML is case sensitive. <literal>Span</literal> or
         <literal>span</literal> is not the same as
         <literal>SPAN</literal>.</para>
         <para>To insert a special character such as < or > literally in
@@ -120,7 +138,7 @@
         </itemizedlist>
         <para>When performing auto indent, a number of mode properties determine
         the resulting indent level:</para>
-        <itemizedlist>        
+        <itemizedlist>
             <listitem>
                 <para>The line and the one before it are scanned for brackets
                 listed in the <literal>indentCloseBrackets</literal> and
@@ -164,7 +182,7 @@
                 and subsequent lines is increased.</para>
 
                 <para> There are corresponding <literal>unindentThisLine</literal> and <literal>unindentNextLines</literal> properties which are checked also, for doing the reverse-indent operation on lines that match certain regular expressions. </para>
-                
+
                 <para>In Java mode, for example, the
                 <literal>indentNextLine</literal> property is set to match
                 control structures such as <quote>if</quote>,
@@ -204,7 +222,7 @@
              <programlisting>def fun1:
     a = 1
     b = 2
-    
+
 def fun2:
              </programlisting>
              Pressing <keycap>C+i</keycap>
@@ -465,9 +483,7 @@ def fun2:
         <para>Note that the <literal>AT_LINE_START</literal>,
         <literal>AT_WHITESPACE_END</literal> and
         <literal>AT_WORD_START</literal> attributes can also be used on the
-        <literal>BEGIN</literal> and <literal>END</literal> elements. Setting
-        these attributes to the same value on both elements has the same effect
-        as setting them on the <literal>SPAN</literal> element.</para>
+        <literal>END</literal> element.</para>
         <para>Here is a <literal>SPAN</literal> that highlights Java string
         literals, which cannot include line breaks:</para>
         <programlisting><SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE">
@@ -859,6 +875,20 @@ def fun2:
     </section>
     <section id="mode-syntax-tokens">
         <title>Token Types</title>
+        <para>The various token types are used to syntax highlight particular
+        words in a language. This makes code easier to read. There is a wide
+        latitude in the usage of the token types, and really it depends on the
+        specifics of the language as to which token represents which type. Some
+        examples are given below, but these are just guidelines, not hard and
+        fast rules.</para>
+        <para>Many languages include constructs from other languages. One common
+        example is html files can include javascript and css blocks. Several of
+        the mode tags support a DELEGATE attribute, which will allow a section
+        of text to be passed to a different mode for highlighting. The html mode
+        delegates to the javascript mode for javascript blocks and to the css
+        mode for style blocks. Use of the DELEGATE attribute is highly encouraged
+        when appropriate since it makes writing modes easier, reduces duplication,
+        and promotes visual consistency across languages.</para>
         <para>Parser rules can highlight tokens using any of the following token
         types:</para>
         <itemizedlist>
@@ -877,18 +907,34 @@ def fun2:
             </listitem>
             <listitem>
                 <para><literal>COMMENT4</literal></para>
+                <para>jEdit supports four different types of comment tokens.
+                Generally, comments are programmer-readable constructs that are
+                ignored by compilers and interpreters. As an example, the lisp
+                mode defines four comment types:
+                </para>
+                <para><EOL_SPAN TYPE="COMMENT4">;;;;</EOL_SPAN></para>
+                <para><EOL_SPAN TYPE="COMMENT3">;;;</EOL_SPAN></para>
+                <para><EOL_SPAN TYPE="COMMENT2">;;</EOL_SPAN></para>
+                <para><EOL_SPAN TYPE="COMMENT1">;</EOL_SPAN></para>
             </listitem>
             <listitem>
                 <para><literal>FUNCTION</literal></para>
+                <para>The function token is intended to identify functions, methods,
+                procedures, routines, or named subprograms.</para>
             </listitem>
             <listitem>
                <para><literal>DIGIT</literal></para>
+               <para>The digit token is to identify numbers.</para>
             </listitem>
             <listitem>
                 <para><literal>INVALID</literal><!--  - tokens of this type are
   automatically added if a <literal>NO_WORD_BREAK</literal> or
   <literal>NO_LINE_BREAK</literal> <literal>SPAN</literal> spans more than
   one word or line, respectively. --></para>
+                <para>The invalid type is to indicate that particular words are
+                not to be used, for example, the java mode defined both "goto"
+                and "const" as invalid words. These are words that are defined
+                by the language, but are not to be used.</para>
             </listitem>
             <listitem>
                 <para><literal>KEYWORD1</literal></para>
@@ -901,9 +947,18 @@ def fun2:
             </listitem>
             <listitem>
                 <para><literal>KEYWORD4</literal></para>
+                <para>
+                    Keywords are used to identify well-defined words within a
+                    language. Some languages naturally divide keywords into
+                    groups, for example, the pascal mode identifies "for" as a
+                    KEYWORD1, "private" as a KEYWORD2, and "int" as a KEYWORD3.
+                </para>
             </listitem>
             <listitem>
                 <para><literal>LABEL</literal></para>
+                <para>A label is generally a named position within a source, for
+                example, the ada mode defined a label as <<foo>>.
+                </para>
             </listitem>
             <listitem>
                 <para><literal>LITERAL1</literal></para>
@@ -916,12 +971,29 @@ def fun2:
             </listitem>
             <listitem>
                 <para><literal>LITERAL4</literal></para>
+                <para>
+                    Literals are usually, but not always, uninterpreted strings,
+                    for example, "foo" or 'bar'. There are a wide variety of
+                    usages of literals in the mode files.
+                </para>
             </listitem>
             <listitem>
                 <para><literal>MARKUP</literal></para>
+                <para>
+                    The markup token is generally used in the various "markup"
+                    languages, such as xml and html. Markup is used for those
+                    elements that are not specified as words belonging to the
+                    language. For example, in html, <body> would be
+                    considered a keyword, where <foo> would be considered
+                    markup.
+                </para>
             </listitem>
             <listitem>
                 <para><literal>OPERATOR</literal></para>
+                <para>
+                    Common examples of operators are the math symbols, such as
+                    '+', '-', and so on.
+                </para>
             </listitem>
         </itemizedlist>
     </section>
diff --git a/doc/welcome.html b/doc/welcome.html
index 80ba472..1ba9eb3 100644
--- a/doc/welcome.html
+++ b/doc/welcome.html
@@ -4,7 +4,7 @@
 
 <center>
 <img src="jedit.png" width="128" height="128">
-<h2>Welcome to jEdit 5</h2>
+<h2>Welcome to jEdit 5.1</h2>
 </center>
 <p> Useful menu commands: </p>
 <ul>
diff --git a/doc/whatsnew/news.xml b/doc/whatsnew/news.xml
index db1aecd..bbf8392 100644
--- a/doc/whatsnew/news.xml
+++ b/doc/whatsnew/news.xml
@@ -4,12 +4,12 @@
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xsi:noNamespaceSchemaLocation='http://www.docbook.org/xsd/4.4/docbook.xsd'>
 
-    <title> What's new in jEdit 5.0 </title>
+    <title> What's new in jEdit 5.1 </title>
     <articleinfo>
         <author>
             <othername>The jEdit all-volunteer development team</othername>
         </author>
-        <date> 2012 </date>
+        <date> 2013 </date>
     </articleinfo>
 
 
@@ -18,34 +18,31 @@
     but here are some of the major features of this version. </para>
 
     <itemizedlist>
-    <listitem><para> Localization - jEdit now supports switching
-    between default locale, French, German, Russian, Czech, and Japanese.
-    Some translations for those locales are provided, containing
-    common jEdit labels. It is also now possible to add new or contribute
-    to existing translation property files for jEdit core
-    as well as for plugins.
-    </para></listitem>
-
-    <listitem><para> Keymaps - named collections of shortcuts. Example keymaps
-    for Emacs, MacOS, German Keyboard, Intellij and classic jEdit are provided,
-    and users can create or customize them.
-    </para></listitem>
 
-    <listitem><para> New Editing options: Disable or simplified automatic
-    indentation, and default response when opening a large file.
+      <listitem><para>VFS WorkThreads have been rewritten into Tasks, making it 
+      possible to completely remove the old "I/O Progress Monitor" and the 
+      wasteful space it took up in the Task Monitor. Old deprecated
+      classes related to WorkThread and WorkThreadPool have been removed.
+      </para></listitem>
+
+      <listitem><para> New Plugin Manager option to check for and disable
+      obsolete plugins. 
+      Enabled by default, this will ensure that old unsupported plugins do not
+      interfere with the running operation of jEdit. </para> 
+    </listitem>
+    <listitem><para> Added another language to our list of translated languages:
+    English, French, German, Japanese, Czech, Russian, and now Chinese!
+    We are always looking for volunteers to help translate jEdit into Hindi,
+    Korean, or Spanish, or any other language, really! It is fairly easy
+    to add a new translation to jEdit or the plugins. 
     </para></listitem>
-
     
-    <listitem><para> Updated html/css edit modes with HTML5/CSS3 keywords.
-    Added a dozen new edit modes, updated a dozen more.
+    <listitem><para> There is now a new encoding Native2ASCII which collapses
+    unicode escapes in ISO-8859-1 files on read and expands characters that
+    cannot be encoded with ASCII as unicode escapes on write. This encoding is
+    the one Java properties files should be in. 
     </para></listitem>
-
-    <listitem><para> Scrolling - Many bugs (#2832769, #2998294, #3193168,
-    possibly others), related to soft wrap, multiline delete/cut, undo, and
-    folding, that could cause the text area to be confused about its location,
-    are fixed. This greatly improves the stability of jEdit. Thank you,
-    Thomas Meyer!!  </para></listitem>
-
-    </itemizedlist>
-<!-- :maxLineLen=80:wrap=hard: -->
+    
+</itemizedlist> 
+<!-- :maxLineLen=80:wrap=hard: --> 
 </article>
diff --git a/installer/OperatingSystem.java b/installer/OperatingSystem.java
index 73c88e8..7e301dd 100644
--- a/installer/OperatingSystem.java
+++ b/installer/OperatingSystem.java
@@ -108,6 +108,8 @@ public abstract class OperatingSystem
 			String osName = System.getProperty("os.name");
 			if(osName.indexOf("Windows") != -1)
 				os = new Windows();
+			else if(osName.indexOf("OS/2") != -1)
+				os = new HalfAnOS();
 			else if(osName.indexOf("VMS") != -1)
 				os = new VMS();
 			else
@@ -196,7 +198,7 @@ public abstract class OperatingSystem
 				out.write("\n");
 				out.write("# Launch application.\n");
 				out.write("\n");
-				out.write("exec \"${JAVA}\" -jar \""
+				out.write("exec \"${JAVA}\" -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -jar \""
 					  + installDir + File.separator
 					  + "jedit.jar\" -reuseview \"$@\"\n");
 				out.close();
@@ -353,6 +355,14 @@ public abstract class OperatingSystem
 		}
 	}
 
+	public static class HalfAnOS extends OperatingSystem
+	{
+		public String getInstallDirectory(String name, String version)
+		{
+			return "C:\\" + name + " " + version;
+		}
+	}
+
 	public static class VMS extends OperatingSystem
 	{
 		public String getInstallDirectory(String name, String version)
diff --git a/installer/ServerKiller.java b/installer/ServerKiller.java
index 7768908..5b6cf05 100644
--- a/installer/ServerKiller.java
+++ b/installer/ServerKiller.java
@@ -71,7 +71,7 @@ public class ServerKiller
 				int port = Integer.parseInt(in.readLine());
 				int key = Integer.parseInt(in.readLine());
 
-				Socket socket = new Socket(InetAddress.getByName("127.0.0.1"),port);
+				Socket socket = new Socket(InetAddress.getByName(null),port);
 				DataOutputStream out = new DataOutputStream(
 					socket.getOutputStream());
 				out.writeInt(key);
diff --git a/installer/done-HalfAnOS.html b/installer/done-HalfAnOS.html
new file mode 100644
index 0000000..405800e
--- /dev/null
+++ b/installer/done-HalfAnOS.html
@@ -0,0 +1,8 @@
+<html><body>
+
+jEdit has been installed successfully.<p>
+
+To start jEdit, run the <tt>jedit.cmd</tt> script located in the
+installation directory.
+
+</body></html>
diff --git a/installer/install.props b/installer/install.props
index 7631dcd..943dc40 100644
--- a/installer/install.props
+++ b/installer/install.props
@@ -23,7 +23,7 @@ ostask.unix-man.manpage=jedit.1
 # Each component must have a name, a size, and a 'fileset'. The fileset is the
 # name of a resource, relative to the root of the JAR, where the list of files
 # is stored, newline delimited
-comp.count=5
+comp.count=6
 
 comp.0.name=jEdit text editor
 comp.0.disk-size=@jedit-program.disksize@
@@ -52,6 +52,12 @@ comp.4.real-size=@jedit-mac.realsize@
 comp.4.fileset=jedit-mac
 comp.4.os=MacOS
 
+comp.5.name=OS/2 start script
+comp.5.disk-size=@jedit-os2.disksize@
+comp.5.real-size=@jedit-os2.realsize@
+comp.5.fileset=jedit-os2
+comp.5.os=HalfAnOS
+
 dir.null=Empty directory: will NOT be installed
 dir.not-empty=Target directory exists and is not empty
 dir.not-directory=Target is NOT a directory, can't install
diff --git a/ivy.xml b/ivy.xml
index f2b8533..847b7ba 100644
--- a/ivy.xml
+++ b/ivy.xml
@@ -83,6 +83,7 @@
 		<dependency org="bsf" name="bsf" rev="2.4.0" conf="scripting"/>
 		<dependency org="org.beanshell" name="bsh" rev="2.0b4" conf="scripting"/>
 		<dependency org="org.bouncycastle" name="bcpg-jdk16" rev="1.46" conf="scripting"/>
-		<dependency org="com.google.code.findbugs" name="jsr305" rev="2.0.0" conf="compile"/>
+
+		<dependency org="com.google.code.findbugs" name="jsr305" rev="2.0.0"/>
 	</dependencies>
 </ivy-module>
diff --git a/keymaps/Emacs_keys.props b/keymaps/Emacs_keys.props
index ab1155b..e0cf9a8 100644
--- a/keymaps/Emacs_keys.props
+++ b/keymaps/Emacs_keys.props
@@ -1,5 +1,4 @@
 #jEdit's keymap Emacs
-#Wed Dec 07 12:46:21 PST 2011
 action-bar.shortcut=C+ENTER
 activator.reloader.shortcut=CA+r
 backspace.shortcut=BACK_SPACE
@@ -16,39 +15,19 @@ close-docking-area.shortcut=ESCAPE ESCAPE
 close-view.shortcut=C+x C+v
 collapse-all-folds.shortcut=CA+LEFT
 collapse-fold.shortcut=A+BACK_SPACE
-commando.ant.shortcut=C+F10
-commando-compile.shortcut=F9
-commando.make.shortcut=A+F10
-console-clear.shortcut=A+c A+c
-console.shell.BeanShell-show.shortcut=A+c b
-console.shell.JavaScript-show.shortcut=A+c j
-console.shell.Python-show.shortcut=A+c p
-console.shell.ssh-show.shortcut=A+c h
-console.shell.System-show.shortcut=A+c s
 console.shortcut=A+x
 copy-append-string-register.shortcut=C+r C+a
 copy.shortcut2=CS+c
-copy.shortcut=C+c
+copy.shortcut=C+c C+c
 copy-string-register.shortcut=C+r C+c
 cscopefinder-find-calling.shortcut=CS+r
 ctags-interface-change-db-settings.shortcut=C+F11
 ctags-interface-complete-from-db.shortcut=CS+SPACE
 ctags-interface-jump-to-tag.shortcut=CS+d
 ctags-interface-preview-toggle.shortcut=C+q C+t
+cut.shortcut=C+c C+x
 C/Toggle_Header_Source.shortcut2=CA+h
 C/Toggle_Header_Source.shortcut=A+h
-cut.shortcut2=C+x C+x
-cut.shortcut=C+w
-debugger-finish.shortcut=C+q F9
-debugger-gdb-output-toggle.shortcut=C+q g
-debugger-go.shortcut=C+q F5
-debugger-next.shortcut=C+q n
-debugger-program-output-toggle.shortcut=C+q o
-debugger-show-locals-toggle.shortcut=C+q l
-debugger-show-variables-toggle.shortcut=C+q v
-debugger-toggle-breakpoint.shortcut=C+F8
-debugger-until.shortcut=C+q F6
-debugger-watches-toggle.shortcut=C+q e
 delete-end-line.shortcut=CS+DELETE
 delete.shortcut2=C+d
 delete.shortcut=DELETE
@@ -58,19 +37,38 @@ document-end.shortcut=C+END
 document-end.shortcut2=ESCAPE >
 document-home.shortcut=C+HOME
 document-home.shortcut2=ESCAPE <
-Editing/Emacs_Ctrl-K.shortcut=C+k
-Editing/Emacs_Next_Line.shortcut=C+n
-Editing/Emacs_Previous_Line.shortcut=C+p
 Editing/Move_Lines_Down.shortcut=C+m C+d
 Editing/Move_Lines_Up.shortcut=C+m C+u
+Emacs/Emacs_Backward_Sentence.shortcut=A+a
+Emacs/Emacs_Capitalize_Word.shortcut=A+c
+Emacs/Emacs_Center_Line.shortcut=A+s
+Emacs/Emacs_Downcase_Word.shortcut=A+l
+Emacs/Emacs_Exchange_Point_and_Mark.shortcut=C+x C+x
+Emacs/Emacs_Fixup_Whitespace.shortcut=A+SPACE
+Emacs/Emacs_Forward_Sentence.shortcut=A+e
+Emacs/Emacs_Insert_File.shortcut=C+x i
+Emacs/Emacs_Kill_Line.shortcut=C+k
+Emacs/Emacs_Kill_Region.shortcut=C+w
+Emacs/Emacs_Kill_Ring_Save.shortcut=A+w
+Emacs/Emacs_Kill_Sentence.shortcut=A+k
+Emacs/Emacs_Next_Line.shortcut=C+n
+Emacs/Emacs_Previous_Line.shortcut=C+p
+Emacs/Emacs_Open_Line.shortcut=C+o
+Emacs/Emacs_Set_Mark.shortcut=C+SPACE
+Emacs/Emacs_Set_Mark.shortcut2=ESCAPE m
+Emacs/Emacs_Set_Wrap.shortcut=C+x f
+Emacs/Emacs_Transpose_Chars.shortcut=C+t
+Emacs/Emacs_Transpose_Lines.shortcut=C+x C+t
+Emacs/Emacs_Upcase_Word.shortcut=A+u
+Emacs_Fixup_Whitespace.shortcut=A+SPACE
 end.shortcut=END
 error-list-next-error.shortcut=F4
 error-list-toggle.shortcut2=C+x e
 error-list-toggle.shortcut=CA+e
 exit.shortcut2=C+x C+c
 exit.shortcut=C+q C+q
-expand-abbrev.shortcut2=C+;
-expand-abbrev.shortcut=C+SEMICOLON
+expand-abbrev.shortcut2=C+.
+expand-abbrev.shortcut=C+PERIOD
 expand-all-folds.shortcut2=CS+ENTER
 expand-all-folds.shortcut=CA+RIGHT
 expand-fold.shortcut=AS+ENTER
@@ -81,18 +79,19 @@ find-next.shortcut=F3
 find-prev.shortcut=S+F3
 find.shortcut2=CS+f
 find.shortcut=C+r C+r
-format-paragraph.shortcut2=A+j
+format-paragraph.shortcut2=A+q
 combined-options.shortcut=A+o
 combined-options.shortcut2=C+F12
 goto-line.shortcut=C+g
+goto-line.shortcut2=A+g
 help.shortcut=F1
 home.shortcut=HOME
 hypersearch.shortcut=C+PERIOD
 indent.shortcut=C+x C+b
+indent-lines.shortcut=TAB
 insert-literal.shortcut=C+6
 insert-newline-indent.shortcut=ENTER
 insert-newline.shortcut=S+ENTER
-insert-tab-indent.shortcut=TAB
 insert-tab.shortcut=C+i
 Interface/Decrease_Font_Size.shortcut=C+SUBTRACT
 Interface/Increase_Font_Size.shortcut=C+ADD
@@ -137,15 +136,16 @@ next-textarea.shortcut2=C+x C+n
 next-textarea.shortcut=C+x n
 next-word-std.shortcut2=A+f
 next-word-std.shortcut=C+RIGHT
-open-file.shortcut=C+o
+open-file.shortcut=C+x C+f
 overwrite.shortcut=INSERT
 paste.shortcut=C+y
+paste-previous.shortcut=A+y
 paste-string-register.shortcut=C+r C+v
 prev-buffer.shortcut=C+PAGE_UP
 prev-char.shortcut2=C+b
 prev-char.shortcut=LEFT
 prev-line.shortcut=UP
-prev-page.shortcut2=ESCAPE v
+prev-page.shortcut2=A+v
 prev-page.shortcut=PAGE_UP
 prev-paragraph.shortcut=C+UP
 prev-textarea.shortcut2=C+x C+p
@@ -153,12 +153,8 @@ prev-textarea.shortcut=C+x p
 prev-word.shortcut=C+LEFT
 prev-word-std-after.shortcut=A+b
 print.shortcut=PRINTSCREEN
-projectviewer_jarmaker_dialog.shortcut=C+r C+j
 projectviewer_parent-group.shortcut=A+UP
 projectviewer_set-active.shortcut=A+DOWN
-projectviewer.shortcut2=A+p A+p
-projectviewer.shortcut=CA+p
-projectviewer-toggle.shortcut2=S+F2
 projectviewer_wrapper_search_project.shortcut=C+F6
 Properties/Create_Plugin_Announcement.shortcut2=C+q c
 Properties/Create_Plugin_Announcement.shortcut=A+BACK_QUOTE
@@ -169,14 +165,11 @@ recentbufferswitcher.shortcut=C+TAB
 record-macro.shortcut=C+m C+r
 redo.shortcut=CS+z
 reload.shortcut=F5
+save-all.shortcut=C+x ENTER
 save-as.shortcut=C+x C+w
 save.shortcut2=C+x C+BACK_SLASH
 save.shortcut=C+s
 scroll-and-center.shortcut=C+l
-scroll-down-line.shortcut=C+SLASH
-scroll-down-page.shortcut=A+SLASH
-scroll-up-line.shortcut=C+QUOTE
-scroll-up-page.shortcut=A+QUOTE
 select-all.shortcut=A+a
 select-block.shortcut=C+OPEN_BRACKET
 select-document-end.shortcut=CS+END
@@ -206,12 +199,7 @@ shift-left.shortcut2=S+TAB
 show-call-tree.shortcut=CS+t
 show-context-menu.shortcut=CONTEXT_MENU
 show-references.shortcut=CS+r
-sidekick-complete.shortcut=C+SPACE
 sidekick-next-asset.shortcut=C+j C+n
-sidekick.parser.ctags-switch.shortcut=A+s c
-sidekick.parser.java-switch.shortcut=A+s j
-sidekick.parser.outline-switch.shortcut=A+s o
-sidekick.parser.xml-switch.shortcut=A+s x
 sidekick-prev-asset.shortcut=C+j C+p
 sidekick-tree-toggle.shortcut2=C+F2
 sidekick-tree-toggle.shortcut=CA+s
@@ -220,19 +208,20 @@ smart-home.shortcut=C+a
 smart-open-dialog.shortcut=C+x C+o
 spell-check-selection.shortcut=F7
 split-horizontal.shortcut=C+2
+split-horizontal.shortcut2=C+x 2
+unsplit-current.shortcut2=C+x 1
 split-vertical.shortcut=C+3
 stop-recording.shortcut=C+m C+s
 tabs-to-spaces.shortcut=C+x C+t
-Text/Insert_Date.shortcut=A+d
+delete-word.shortcut2=A+d
 toggle-buffer-switcher.shortcut=ESCAPE s
 toggle-dock-areas.shortcut=F12
 toggle-dual-diff.shortcut=C+q d
 toggle-full-screen.shortcut=F11
 toggle-rect-select.shortcut=A+BACK_SLASH
-to-lower.shortcut2=A+l
-to-upper.shortcut2=A+u
 transpose-chars.shortcut=C+t
 undo.shortcut=C+z
+undo.shortcut2=C+SLASH
 unsplit-current.shortcut=C+0
 unsplit.shortcut=C+1
 updater-update-default.shortcut=C+x C+u
diff --git a/keymaps/Mac_OS_X_keys.props b/keymaps/Mac_OS_X_keys.props
index 683bf32..2eeb390 100644
--- a/keymaps/Mac_OS_X_keys.props
+++ b/keymaps/Mac_OS_X_keys.props
@@ -2,6 +2,7 @@ action-bar.shortcut=C+ENTER
 add-explicit-fold.shortcut=MC+a
 add-marker-shortcut.shortcut=C+t
 add-marker.shortcut=C+m
+backspace-word-std.shortcut2=A+k
 backspace-word.shortcut=C+BACK_SPACE
 backspace.shortcut=BACK_SPACE
 bottom-docking-area.shortcut=MC+DOWN
@@ -27,11 +28,14 @@ cut.shortcut2=S+DELETE
 cut.shortcut=C+x
 delete-end-line.shortcut=CS+DELETE
 delete-line.shortcut=C+d
+delete-paragraph.shortcut2=A+h
 delete-start-line.shortcut=CS+BACK_SPACE
 delete-word.shortcut=C+DELETE
 delete.shortcut2=A+d
 delete.shortcut=DELETE
+document-end.shortcut2=C+DOWN
 document-end.shortcut=C+END
+document-home.shortcut2=C+UP
 document-home.shortcut=C+HOME
 end.shortcut2=C+RIGHT
 end.shortcut=END
@@ -45,7 +49,6 @@ find-prev.shortcut=CS+g
 find-previous.shortcut=C+e g
 find.shortcut=C+f
 focus-buffer-switcher.shortcut=A+BACK_QUOTE
-format-paragraph.shortcut=MC+f
 global-close-buffer.shortcut=MC+w
 global-options.shortcut=C+F12
 goto-line.shortcut=A+g
@@ -54,6 +57,7 @@ help.shortcut=F1
 home.shortcut2=C+LEFT
 home.shortcut=HOME
 hypersearch-word.shortcut=A+PERIOD
+hypersearch.shortcut2=MC+f
 hypersearch.shortcut=C+PERIOD
 ignore-case.shortcut=AC+i
 indent-lines.shortcut=A+i
@@ -66,19 +70,20 @@ last-macro.shortcut=C+m C+l
 latextools-compile.shortcut=F6
 left-docking-area.shortcut=MC+LEFT
 line-comment.shortcut=AC+SLASH
+line-end.shortcut=A+e
+line-home.shortcut=A+a
 new-file-in-mode.shortcut=CS+n
 new-file.shortcut=C+n
 next-bracket.shortcut=AC+CLOSE_BRACKET
+next-buffer.shortcut2=A+f
 next-buffer.shortcut=C+PAGE_DOWN
-next-char.shortcut2=A+l
 next-char.shortcut=RIGHT
 next-fold.shortcut=A+DOWN
-next-line.shortcut2=A+k
 next-line.shortcut=DOWN
 next-marker.shortcut=AC+PERIOD
-next-page.shortcut2=A+a
+next-page.shortcut2=A+v
 next-page.shortcut=PAGE_DOWN
-next-paragraph.shortcut=C+DOWN
+next-paragraph.shortcut=M+DOWN
 next-textarea.shortcut=A+PAGE_DOWN
 next-word.shortcut=M+RIGHT
 open-file.shortcut=C+o
@@ -93,14 +98,13 @@ paste.shortcut2=S+INSERT
 paste.shortcut=C+v
 prev-bracket.shortcut=AC+OPEN_BRACKET
 prev-buffer.shortcut=C+PAGE_UP
-prev-char.shortcut2=A+j
+prev-char.shortcut2=A+b
 prev-char.shortcut=LEFT
 prev-fold.shortcut=A+UP
 prev-line.shortcut=UP
 prev-marker.shortcut=AC+COMMA
-prev-page.shortcut2=A+q
 prev-page.shortcut=PAGE_UP
-prev-paragraph.shortcut=C+UP
+prev-paragraph.shortcut=M+UP
 prev-textarea.shortcut=A+PAGE_UP
 prev-word.shortcut=M+LEFT
 print.shortcut=C+p
@@ -123,6 +127,7 @@ save-as.shortcut=CS+s
 save.shortcut=C+s
 scroll-and-center.shortcut=C+l
 scroll-down-page.shortcut=A+SLASH
+scroll-to-current-line.shortcut2=A+l
 scroll-to-current-line.shortcut=C+j
 scroll-up-line.shortcut=C+QUOTE
 scroll-up-page.shortcut=A+QUOTE
@@ -145,7 +150,7 @@ select-next-line.shortcut2=AS+k
 select-next-line.shortcut=S+DOWN
 select-next-page.shortcut2=AS+a
 select-next-page.shortcut=S+PAGE_DOWN
-select-next-paragraph.shortcut=CS+DOWN
+select-next-paragraph.shortcut=MS+DOWN
 select-next-word.shortcut=MS+RIGHT
 select-none.shortcut=CS+a
 select-paragraph.shortcut=MC+p
@@ -155,7 +160,7 @@ select-prev-line.shortcut2=AS+i
 select-prev-line.shortcut=S+UP
 select-prev-page.shortcut2=AS+q
 select-prev-page.shortcut=S+PAGE_UP
-select-prev-paragraph.shortcut=CS+UP
+select-prev-paragraph.shortcut=MS+UP
 select-prev-word.shortcut=MS+LEFT
 shift-left.shortcut2=S+TAB
 shift-left.shortcut=C+OPEN_BRACKET
diff --git a/macros/C/Toggle_Header_Source.bsh b/macros/C/Toggle_Header_Source.bsh
index f5ebe74..a828ba3 100644
--- a/macros/C/Toggle_Header_Source.bsh
+++ b/macros/C/Toggle_Header_Source.bsh
@@ -1,7 +1,7 @@
 /**
-	ToggleHeaderSource.bsh V1.5
+	ToggleHeaderSource.bsh V1.6
 	by Alan Ezust
-	$Id: Toggle_Header_Source.bsh 21514 2012-03-31 05:21:10Z ezust $
+	$Id: Toggle_Header_Source.bsh 22405 2012-10-26 17:13:58Z ezust $
 
 	A jedit beanshell macro that toggles your current buffer
 	between the header file (.hh?) and the source file (.c(c|pp|xx)?).
@@ -24,6 +24,9 @@
 
 	New to 1.5: Supports multiple, default header extensions.
 
+	New to 1.6: Does nothing when not in the correct mode (c or c++)
+	Fixed a bug where it did not work without projectviewer installed. 
+	
 	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
@@ -59,12 +62,7 @@ String[] headerExtensions = new String[]{"h", "hh", "hpp", "hxx"};
    @return the absolute path if found, NULL if not.
    */
 String findBufferInProject(String fileName) {
-    int sep1 = fileName.lastIndexOf('\\');
-    int sep2 = fileName.lastIndexOf('/');
-    if (sep1 > sep2)
-        fileName = fileName.substring(sep1 + 1);
-    else if (sep2 > sep1)
-        fileName = fileName.substring(sep2 + 1);
+    fileName = MiscUtilities.getFileName(fileName);
     VPTProject project = ProjectViewer.getActiveProject(view);
     Collection nodes = project.getOpenableNodes();
     for (VPTNode node: nodes) {
@@ -148,7 +146,7 @@ String getHeaderFile(String baseName)
     if (path != null) return path;
 
     // Then try current project
-    if (activeProjectExists())
+    if (activeProjectExists()) {
         for (int i=numExt-1; i>=0; --i)
         {
             String ext = headerExtensions[i];
@@ -157,7 +155,10 @@ String getHeaderFile(String baseName)
             if (path != null) return path;
         }
     // No extension at all in project:
-    return findBufferInProject(baseName);
+        path = findBufferInProject(baseName);
+        if (path != null) return path;
+    }
+    return baseName + "." + defaultHeaderExtension;
 }
 
 boolean isSourceFile(String extension)
@@ -171,6 +172,8 @@ boolean isSourceFile(String extension)
 
 void toggleHeaderSource()
 {
+    String mode = buffer.getMode().toString();
+    if (! (mode.equals("c") || mode.equals("c++"))) return;
     String currentFile = buffer.getPath();
     int pos = currentFile.lastIndexOf('.');
 	String path = null;
@@ -185,7 +188,7 @@ void toggleHeaderSource()
             path = getHeaderFile(baseName);
             if (path == null)
                 path = baseName + "." + defaultHeaderExtension;
-        }
+        } 
         else
         {
             path = getSourceFile(baseName);
@@ -206,6 +209,5 @@ void toggleHeaderSource()
 	jEdit.openFile(view, path);
 }
 
-toggleHeaderSource();
-
 
+toggleHeaderSource();
diff --git a/macros/Clipboard/Copy_Lines.bsh b/macros/Clipboard/Copy_Lines.bsh
index a761615..834b19a 100644
--- a/macros/Clipboard/Copy_Lines.bsh
+++ b/macros/Clipboard/Copy_Lines.bsh
@@ -5,7 +5,7 @@
 *
 * Copyright (C) 2003 Ollie Rutherfurd <oliver at jedit.org>
 *
-* $Id: Copy_Lines.bsh 20582 2011-12-08 21:26:00Z kpouer $
+* $Id: Copy_Lines.bsh 22664 2013-01-09 13:16:00Z kpouer $
 */
 
 copyLines()
@@ -18,7 +18,16 @@ copyLines()
 	}
 	start = textArea.getLineStartOffset(selections[0]);
 	stop = textArea.getLineEndOffset(selections[selections.length-1]);
-	String text = textArea.getText(start,stop-start);
+	int bufferLength = buffer.getLength();
+	String text;
+	if (stop > bufferLength)
+	{
+		text = textArea.getText(start,bufferLength - start) + '\n';
+	}
+	else
+	{
+		text = textArea.getText(start,stop-start);
+	}
 	java.awt.datatransfer.Transferable value = new java.awt.datatransfer.StringSelection(text);
 	Registers.getRegister('$').setTransferable(value);
 }
diff --git a/macros/Clipboard/Cut_Lines.bsh b/macros/Clipboard/Cut_Lines.bsh
index 3688d2e..39b7e33 100644
--- a/macros/Clipboard/Cut_Lines.bsh
+++ b/macros/Clipboard/Cut_Lines.bsh
@@ -6,10 +6,12 @@
 * Copyright (C) 2003 Ollie Rutherfurd <oliver at jedit.org>
 * Copyright (c) 2008 encorejane at users.sourceforge.net
 *
-* $Id: Cut_Lines.bsh 11860 2008-02-24 23:43:28Z ezust $
+* $Id: Cut_Lines.bsh 22664 2013-01-09 13:16:00Z kpouer $
 */
 
 cutLines(){
+	if (buffer.getLength() == 0)
+		return;
 	selections = textArea.getSelectedLines();
 	
 	if(selections.length == 0){
diff --git a/macros/Editing/Move_Lines_Down.bsh b/macros/Editing/Move_Lines_Down.bsh
index 54aace7..f22beb8 100644
--- a/macros/Editing/Move_Lines_Down.bsh
+++ b/macros/Editing/Move_Lines_Down.bsh
@@ -3,6 +3,8 @@ Move_Lines_Down.bsh - Beanshell macro to move a selection of lines down by one
 line.  This should handle multiple selections, but doesn't work quite right.
 
 Copyright (c) Dale Anson, 2004
+ :tabSize=4:indentSize=4:noTabs=false:
+ :folding=explicit:collapseFolds=1:
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -32,78 +34,70 @@ final static String NotEditableMessage = jEdit.getProperty("macro.rs.general.Err
 final static String NoMultipleSelectionError = jEdit.getProperty("macro.rs.MoveLines.NoMultipleSelection.error", "Line move does not work with multiple selection.");
 
 // check buffer read-only status
-if ( buffer.isReadOnly() ) {
-   Macros.error( view, NotEditableMessage );
-   return ;
-}
-
-Mode mode = buffer.getMode();
-boolean shouldIndent = false;
-String[] indentProps = new String[]{"indentOpenBrackets", "indentOpenBrackets", "unalignedOpenBrackets", "unalignedCloseBrackets", "indentNextLine", "unindentThisLine", "electricKeys", "doubleBracketIndent", "lineUpClosingBracket"};
-for (String name : indentProps) {
-    if (mode.getProperty(name) != null) {
-        shouldIndent = true;
-        break;
-    }
+if (buffer.isReadOnly())
+{
+	Macros.error( view, NotEditableMessage );
+	return;
 }
 
 // get the current selection or the current line if no selection
 Selection[] selections = textArea.getSelection();
 
 // this doesn't work right with multiple selection, so don't do anything
-if (selections.length > 1) {
-   Macros.error( view, NoMultipleSelectionError );
-   return ;
+if (selections.length > 1)
+{
+	Macros.error( view, NoMultipleSelectionError );
+	return;
 }
 
-String ls = buffer.getStringProperty( "lineSeparator" );
+int lineStart; 
+int lineEnd;
+if (selections.length == 0)
+{
+	lineStart = textArea.getCaretLine();
+	lineEnd = lineStart;
+}
+else
+{
+	lineEnd = selections[0].getEndLine();
+	lineStart = selections[0].getStartLine();
+}
 
-int line = textArea.getCaretLine();
+if (lineEnd == buffer.getLineCount() - 1)
+	return;
 
-// make sure last line ends with a line separator
-String line_text = textArea.getLineText(textArea.getLineCount() - 1);
-if (!line_text.endsWith(ls) && line >= textArea.getLineCount() - 3) {
-    buffer.insert(buffer.getLength(), ls);
-}
+int start_offset = textArea.getLineStartOffset(lineStart);
 
-// if nothing is selected, select current line
-if (selection == null || selections.length == 0) {
-   selections = new Selection[1];
-   int start_offset = textArea.getLineStartOffset(line);
-   int end_offset = textArea.getLineEndOffset(line);
-   selections[0] = new Selection.Range(start_offset, end_offset);
-   textArea.addToSelection(selections[0]);
-}
+int nextLine = lineEnd + 1;
+String nextLineText = buffer.getLineText(nextLine);
+int nextLineLength = nextLineText.length();
 
-// adjust the start and end line offsets to reselect after the move
-int[] startLines = new int[selections.length];
-int[] endLines = new int[selections.length];
-for (int i = 0; i < selections.length; i++) {
-   startLines[i] = selections[i].getStartLine() + 1;
-   endLines[i] = selections[i].getEndLine() + 1;
-}
+boolean lastLine = nextLine == buffer.getLineCount() - 1;
 
-// cut the selected text, move down one line, and paste it back in
-Registers.cut( textArea, '_' );
-textArea.goToNextLine( false );
-Registers.paste( textArea, '_', false );
-textArea.goToPrevLine( false );
-
-// indent lines
-if (shouldIndent) {
-    for (int i = 0; i < startLines.length; i++) {
-        buffer.indentLines( startLines[i] - 1, endLines[i] );
-    }
-}
+if (lastLine)
+	buffer.remove(buffer.getLineStartOffset(nextLine), nextLineLength);
+else
+	buffer.remove(buffer.getLineStartOffset(nextLine), nextLineLength + 1);
+String lineSeparator = buffer.getStringProperty( "lineSeparator" );
+buffer.insert(start_offset, nextLineText + lineSeparator);
 
-// reselect the moved text
-textArea.selectNone();
-for (int i = 0; i < startLines.length; i++) {
-   selection = new Selection.Range(
-      textArea.getLineStartOffset( startLines[i] ),
-      textArea.getLineStartOffset( endLines[i] )
-   );
-   textArea.addToSelection(selection);
+if (lastLine)
+{
+	buffer.remove(buffer.getLength() - 1, 1);
+}
+	
+Mode mode = buffer.getMode();
+String[] indentProps = new String[]{"indentOpenBrackets", "indentOpenBrackets",
+	"unalignedOpenBrackets", "unalignedCloseBrackets", "indentNextLine", 
+	"unindentThisLine", "electricKeys", "doubleBracketIndent", 
+	"lineUpClosingBracket"};
+for (String name : indentProps) 
+{
+	if (mode.getProperty(name) != null)
+	{
+		buffer.indentLines(lineStart + 1, lineEnd + 1);
+		break;
+	}
 }
 
 
diff --git a/macros/Editing/Move_Lines_Up.bsh b/macros/Editing/Move_Lines_Up.bsh
index d6e8f83..4f21ef3 100644
--- a/macros/Editing/Move_Lines_Up.bsh
+++ b/macros/Editing/Move_Lines_Up.bsh
@@ -1,8 +1,10 @@
 /*
-Move_Lines_Up.bsh - Beanshell macro to move a selection of lines up by one line.
-This should handle multiple selections, but doesn't work quite right.
+Move_Lines_Down.bsh - Beanshell macro to move a selection of lines down by one
+line.  This should handle multiple selections, but doesn't work quite right.
 
 Copyright (c) Dale Anson, 2004
+ :tabSize=4:indentSize=4:noTabs=false:
+ :folding=explicit:collapseFolds=1:
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -32,83 +34,78 @@ final static String NotEditableMessage = jEdit.getProperty("macro.rs.general.Err
 final static String NoMultipleSelectionError = jEdit.getProperty("macro.rs.MoveLines.NoMultipleSelection.error", "Line move does not work with multiple selection.");
 
 // check buffer read-only status
-if ( buffer.isReadOnly() ) {
-   Macros.error( view, NotEditableMessage );
-   return ;
-}
-
-Mode mode = buffer.getMode();
-boolean shouldIndent = false;
-String[] indentProps = new String[]{"indentOpenBrackets", "indentOpenBrackets", "unalignedOpenBrackets", "unalignedCloseBrackets", "indentNextLine", "unindentThisLine", "electricKeys", "doubleBracketIndent", "lineUpClosingBracket"};
-for (String name : indentProps) {
-    if (mode.getProperty(name) != null) {
-        shouldIndent = true;
-        break;
-    }
+if (buffer.isReadOnly())
+{
+	Macros.error( view, NotEditableMessage );
+	return;
 }
 
 // get the current selection or the current line if no selection
 Selection[] selections = textArea.getSelection();
 
 // this doesn't work right with multiple selection, so don't do anything
-if (selections.length > 1) {
-   Macros.error( view, NoMultipleSelectionError );
-   return ;
+if (selections.length > 1)
+{
+	Macros.error( view, NoMultipleSelectionError );
+	return;
 }
 
-String ls = buffer.getStringProperty( "lineSeparator" );
-
-int line = textArea.getCaretLine();
-if (line == 0) {
-    return;  // at top, nowhere to go from here
-}
-if (line == textArea.getLineCount() - 1) {
-    // on last line, make sure it ends with a line separator
-    String line_text = textArea.getLineText(line);
-    if (!line_text.endsWith(ls)) {
-        buffer.insert(buffer.getLength(), ls);
-    }
+int oldCaretPosition = textArea.getCaretPosition();
+int lineStart; 
+int lineEnd;
+if (selections.length == 0)
+{
+	lineStart = textArea.getCaretLine();
+	lineEnd = lineStart;
 }
+else
+{
+	lineStart = selections[0].getStartLine();
 
-// if nothing is selected, select current line
-if (selection == null || selections.length == 0) {
-   selections = new Selection[1];
-   int start_offset = textArea.getLineStartOffset(line);
-   int end_offset = textArea.getLineEndOffset(line);
-   selections[0] = new Selection.Range(start_offset, end_offset);
-   textArea.addToSelection(selections[0]);
+	lineEnd = selections[0].getEndLine();
 }
 
-// adjust the start and end line offsets to reselect after the move
-int[] startLines = new int[selections.length];
-int[] endLines = new int[selections.length];
-for (int i = 0; i < selections.length; i++) {
-    if (selections[i].getStartLine() == 0) {
-        return;  // at top, nowhere to go from here
-    }
-   startLines[i] = selections[i].getStartLine() - 1;
-   endLines[i] = selections[i].getEndLine() - 1;
-}
+if (lineStart == 0)
+	return;
+
+int end_offset = textArea.getLineEndOffset(lineEnd);
+
+int prevLine = lineStart - 1;
+int prevLineStartOffset = buffer.getLineStartOffset(prevLine);
+String prevLineText = buffer.getLineText(prevLine);
+Log.log(Log.DEBUG, this , "prev=" + prevLineText + " endOFfset=" + end_offset);
+int prevLineLength = prevLineText.length();
+
+boolean lastLine = lineEnd == buffer.getLineCount() - 1;
 
-// cut the selected text, move up one line, and paste it back in
-Registers.cut( textArea, '_' );
-textArea.goToPrevLine( false );
-Registers.paste( textArea, '_', false );
-textArea.goToPrevLine( false );
-
-// indent lines
-if (shouldIndent) {
-    for (int i = 0; i < startLines.length; i++) {
-        buffer.indentLines( startLines[i], endLines[i] + 1 );
-    }
+String lineSeparator = buffer.getStringProperty( "lineSeparator" );
+
+if (lastLine)
+	buffer.insert(end_offset - 1, lineSeparator + prevLineText);
+else
+
+	buffer.insert(end_offset, prevLineText + lineSeparator);
+
+buffer.remove(prevLineStartOffset, prevLineLength + 1);
+
+if (selections.length == 0)
+{
+	textArea.setCaretPosition(oldCaretPosition - prevLineLength - 1);
 }
 
-// reselect the moved text
-textArea.selectNone();
-for (int i = 0; i < startLines.length; i++) {
-   selection = new Selection.Range(
-      textArea.getLineStartOffset( startLines[i] ),
-      textArea.getLineStartOffset( endLines[i] )
-   );
-   textArea.addToSelection(selection);
+Mode mode = buffer.getMode();
+String[] indentProps = new String[]{"indentOpenBrackets", "indentOpenBrackets",
+	"unalignedOpenBrackets", "unalignedCloseBrackets", "indentNextLine", 
+	"unindentThisLine", "electricKeys", "doubleBracketIndent", 
+	"lineUpClosingBracket"};
+for (String name : indentProps) 
+{
+	if (mode.getProperty(name) != null)
+	{
+		buffer.indentLines(lineStart - 1, lineEnd - 1);
+		break;
+	}
 }
+
+
+
diff --git a/macros/Emacs/EmacsUtil.bsh b/macros/Emacs/EmacsUtil.bsh
new file mode 100644
index 0000000..38becd8
--- /dev/null
+++ b/macros/Emacs/EmacsUtil.bsh
@@ -0,0 +1,301 @@
+/**
+* Utility methods for Emacs emulation macros.
+*/
+
+import org.gjt.sp.jedit.Registers;
+import org.gjt.sp.gui.HistoryModel;
+
+boolean repeatingSameMacro (String macroName)
+{
+    ih = textArea.getInputHandler();
+    lastAction = ih.getLastAction();
+    lastActionCount = ih.getLastActionCount();
+    
+    // When called from within a macro, the last action will be that macro.
+    // But, if the last action count is greater than 1, then it's a repeat.
+
+    boolean repeat = false;
+    if ( (lastAction.getName().equals (macroName)) && (lastActionCount > 1) )
+        repeat = true;
+    
+    return repeat;
+}
+
+String lineAt (int i)
+{
+    StringBuffer buf = new StringBuffer();
+    
+    while (! atEndOfBuffer (i))
+    {
+        char c = charAt (i);
+        buf.append (c);
+        if (c == '\n')
+            break;
+    }
+    
+    return buf.toString();
+}
+
+char charAt (int i)
+{
+    return buffer.getText (i, 1).charAt (0);
+}
+
+char charAtCaret()
+{
+    caret = textArea.getCaretPosition();
+    return (atEndOfBuffer() ? '\0' : buffer.getText (caret, 1).charAt (0));
+}
+
+boolean atEndOfBuffer()
+{
+    return atEndOfBuffer (textArea.getCaretPosition());
+}
+
+boolean atEndOfBuffer (int caret)
+{
+    return (caret >= buffer.getLength());
+}
+
+int eatNonAlphanums()
+{
+    boolean eat = true;
+
+    while (eat)
+    {
+        ch = charAtCaret();
+        
+        if (ch == '\n')
+        {
+            textArea.goToNextLine (false);
+            textArea.goToStartOfLine (false);
+        }
+        
+        else
+        {
+            if (Character.isLetterOrDigit (ch))
+                eat = false;
+            
+            else
+                textArea.goToNextCharacter (false);
+        }
+    }
+    
+    return textArea.getCaretPosition();
+}
+       
+int eatWhitespace()
+{
+    boolean eat = true;
+    
+    while (eat)
+    {
+        ch = charAtCaret();
+        
+        if (ch == '\n')
+        {
+            textArea.goToNextLine (false);
+            textArea.goToStartOfLine (false);
+        }
+        
+        else if (Character.isWhitespace (ch))
+        {
+            textArea.goToNextCharacter (false);
+        }
+
+        else
+        {
+            eat = false;
+        }
+    }
+    
+    return textArea.getCaretPosition();
+}
+
+int getCardinalProperty (String name, int defaultValue)
+{
+    int result = jEdit.getIntegerProperty (name, defaultValue);
+
+    if (result <= 0)
+        result = defaultValue;
+    
+    return result;
+}
+
+String makeBufferPropertyName (String prefix)
+{
+    return makeBufferPropertyName (buffer, prefix);
+}
+
+String makeBufferPropertyName (Buffer theBuffer, String prefix)
+{
+    propName = new StringBuffer (prefix);
+
+    // Convert any Windows-style file separators to Unix ones, since
+    // backslashes are special characters in properties files.
+
+    fileSep = System.getProperty ("file.separator");
+    if (! fileSep.equals ("/"))
+    {
+        // Backslash is also special in regular expressions. Since, in theory,
+        // the file separator could be *anything*, we check explicitly for
+        // backslash here.
+
+        if (fileSep.equals ("\\"))
+            fileSep = fileSep + "\\";
+
+        bufName = theBuffer.getPath().replaceAll (fileSep, "/");
+    }
+    
+    else
+    {
+        bufName = theBuffer.getPath();
+    }
+
+    propName.append (bufName);
+    return propName.toString();
+}
+
+int getDefaultWrap()
+{
+    return getCardinalProperty ("buffer.maxLineLen", 79);
+}
+
+int getMark (Buffer buffer)
+{
+    propName = makeBufferPropertyName ("emacs.mark");
+    int mark = getCardinalProperty (propName, -1);
+    if (mark != -1)
+    {
+        if (mark >= buffer.getLength())
+            mark = buffer.getLength() - 1;
+    }
+    return mark;
+}
+
+void setMark (Buffer buffer, int pos)
+{
+    propName = makeBufferPropertyName (buffer, "emacs.mark");
+    jEdit.setTemporaryProperty (propName, String.valueOf (pos));
+}
+
+void beep()
+{
+    view.getToolkit().beep();
+}
+
+Selection getKillRegion()
+{
+    // If there's a selection, use it instead.
+
+    int caret = textArea.getCaretPosition();
+    Selection selection = textArea.getSelectionAtOffset (caret);
+    if (selection == null)
+    {
+        int mark = getMark (buffer);
+        if (mark == -1)
+        {
+            beep();
+            return null;
+        }
+
+        selection = new Selection.Range (Math.min (caret, mark),
+                                         Math.max (caret, mark));
+        textArea.setSelection (selection);
+    }
+
+    return selection;
+}
+
+Registers.Register getClipboard()
+{
+    return Registers.getRegister ('$');
+}
+
+void setClipboard (String string)
+{
+    Registers.setRegister ('$', string);
+}
+
+void setClipboard (Selection selection)
+{
+    setClipboard (textArea.getSelectedText (selection));
+}
+
+void addToClipboardAndHistory (String string)
+{
+    // The special register '$' is the clipboard.
+
+    setClipboard (string);
+    
+    // Save the text in the history, too.
+    
+    HistoryModel.getModel ("clipboard").addItem (string);
+}
+
+void addToClipboardAndHistory (Selection selection)
+{
+    addToClipboardAndHistory (textArea.getSelectedText (selection));
+}
+
+int findEndOfSentence()
+{
+    caret = textArea.getCaretPosition();
+
+    for (;;)
+    {
+        if (atEndOfBuffer (caret))
+            break;
+
+        ch = charAt (caret);
+        if (ch == '.')
+        {
+            if (Character.isWhitespace (charAt (caret + 1)))
+            {
+                caret++;
+                break;
+            }
+        }
+
+        caret++;
+    }
+    
+    return caret;
+}
+
+int findBeginningOfSentence()
+{
+    caret = textArea.getCaretPosition() - 1;
+    if (charAt (caret) == '.')
+        caret--;
+
+    for (;;)
+    {
+        if (caret <= 0)
+            break;
+
+        ch = charAt (caret);
+        if (ch == '.')
+        {
+            if (Character.isWhitespace (charAt (caret + 1)))
+            {
+                caret++;
+                break;
+            }
+        }
+        
+        else if (Character.isUpperCase (ch))
+        {
+            caret--;
+            if (caret <= 0)
+                break;
+            if (Character.isWhitespace (charAt (caret)))
+                break;
+        }
+
+        caret--;
+    }
+    
+    return caret;
+}
+
diff --git a/macros/Emacs/Emacs_Align_Decls.bsh b/macros/Emacs/Emacs_Align_Decls.bsh
new file mode 100644
index 0000000..75c5833
--- /dev/null
+++ b/macros/Emacs/Emacs_Align_Decls.bsh
@@ -0,0 +1,34 @@
+/**
+ * Emulate GNU Emacs's (fixup-whitespace) function (typically bound to
+ * Ctrl-SPACE. Not a complete emulation. Emacs docs for this function:
+ *
+ *     Fixup white space between objects around caret.
+ *     Leave one space or none, according to the context.
+ */
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsAlignDeclarations()
+{
+    caret = textArea.getCaretPosition();
+    caretLine = textArea.getCaretLine();
+    lineStart = textArea.getLineStartOffset (caretLine);
+    lineEnd = textArea.getLineEndOffset (caretLine);
+    
+    if (caretLine.trim().length() == 0)
+        return;
+
+    // Find the end of the block
+    
+    boolean emptyLine = false;
+    caret2 = lineEnd + 1;
+    while (! emptyLine)
+    {
+        line = lineAt (caret2);
+        if (line.trim().length() == 0)
+            break;
+        caret2 = caret2 + line.length();
+    }
+}
+
+emacsFixupWhitespace();
+
diff --git a/macros/Emacs/Emacs_Backward_Sentence.bsh b/macros/Emacs/Emacs_Backward_Sentence.bsh
new file mode 100644
index 0000000..d2b7731
--- /dev/null
+++ b/macros/Emacs/Emacs_Backward_Sentence.bsh
@@ -0,0 +1,13 @@
+/**
+ * Go to the beginning of the current sentence. Emulates the Emacs
+ * "backward-sentence" command.
+ */
+
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsBackwardSentence()
+{
+    textArea.setCaretPosition (findBeginningOfSentence());
+}
+
+emacsBackwardSentence();
diff --git a/macros/Emacs/Emacs_Capitalize_Word.bsh b/macros/Emacs/Emacs_Capitalize_Word.bsh
new file mode 100644
index 0000000..7a76cdc
--- /dev/null
+++ b/macros/Emacs/Emacs_Capitalize_Word.bsh
@@ -0,0 +1,37 @@
+/**
+ * Convert the portion of the current word to title case, starting at the
+ * caret and moving to the end of the word. Emulates the Emacs "capitalize-word"
+ * function.
+ */
+
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsCapitalizeWord()
+{
+    caret = eatNonAlphanums();
+
+    // Adjust to beginning of the word (skipping any non-word chars)
+
+    textArea.goToNextWord (false);
+    endOfWord = textArea.getCaretPosition();
+
+    textArea.setCaretPosition (caret);
+    selection = new Selection.Range (caret, endOfWord);
+
+    word = textArea.getText (caret, endOfWord - caret);
+    if (word.length() > 0)
+    {
+        ch = word.toCharArray();
+        ch[0] = Character.toUpperCase (ch[0]);
+        
+        for (i = 1; i < ch.length; i++)
+            ch[i] = Character.toLowerCase (ch[i]);
+        
+        textArea.setSelection (selection);
+        textArea.setSelectedText (new String (ch));
+        textArea.removeFromSelection (selection);
+    }
+}
+
+emacsCapitalizeWord();
+
diff --git a/macros/Emacs/Emacs_Center_Line.bsh b/macros/Emacs/Emacs_Center_Line.bsh
new file mode 100644
index 0000000..42eee7a
--- /dev/null
+++ b/macros/Emacs/Emacs_Center_Line.bsh
@@ -0,0 +1,66 @@
+/**
+ * Emulates the Emacs "center-line" command, documented as follows (in
+ * GNU Emacs):
+ *
+ *      center-line is an interactive compiled Lisp function in 
+ *      `textmodes/text-mode'.
+ *
+ *      (center-line &optional NLINES)
+ *
+ *     Center the line point is on, within the width specified by `fill-column'.
+ *     This means adjusting the indentation so that it equals
+ *     the distance between the end of the text and `fill-column'.
+ *     The argument NLINES says how many lines to center.
+ */
+
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsCenterLine()
+{
+    caret = textArea.getCaretPosition();
+    caretLine = textArea.getCaretLine();
+    lineStart = textArea.getLineStartOffset (caretLine);
+    lineEnd = textArea.getLineEndOffset (caretLine);
+    lineIndex = textArea.getLineOfOffset (caretLine);
+    defaultFillColumn = getCardinalProperty ("buffer.maxLineLen", 79);
+
+    // Convert the buffer name into a property name.
+
+    propName = makeBufferPropertyName ("emacs.fillColumn.");
+    
+    // Get the buffer-specific fill column.
+    
+    fillColumn = getCardinalProperty (propName, defaultFillColumn);
+
+    if ((! atEndOfBuffer()) && (lineStart < lineEnd))
+    {
+        // Be sure to ignore trailing newline.
+
+        int           len = lineEnd - lineStart - 1;
+        String        line = textArea.getText (lineStart, len).trim();
+        StringBuffer  paddedString = new StringBuffer (fillColumn);
+        int           paddingNeeded;
+        int           frontPadding;
+        int           tailPadding;
+        int           i;
+
+        len = line.length();
+        paddingNeeded = (fillColumn < len) ? 0 : (fillColumn - len);
+        i = paddingNeeded / 2;
+        frontPadding = i;
+        tailPadding  = i + (paddingNeeded % 2);
+
+        for (i = 0; i < frontPadding; i++)
+            paddedString.append (' ');
+
+        paddedString.append (line);
+
+        selection = new Selection.Range (lineStart, lineEnd - 1);
+        textArea.setSelection (selection);
+        textArea.setSelectedText (paddedString.toString());
+    }
+}
+
+emacsCenterLine();
+
+
diff --git a/macros/Editing/Emacs_Ctrl-K.bsh b/macros/Emacs/Emacs_Ctrl-K.bsh
similarity index 100%
rename from macros/Editing/Emacs_Ctrl-K.bsh
rename to macros/Emacs/Emacs_Ctrl-K.bsh
diff --git a/macros/Emacs/Emacs_Downcase_Word.bsh b/macros/Emacs/Emacs_Downcase_Word.bsh
new file mode 100644
index 0000000..8bc22a3
--- /dev/null
+++ b/macros/Emacs/Emacs_Downcase_Word.bsh
@@ -0,0 +1,23 @@
+/**
+ * Convert the portion of the current word to lower case, starting at the
+ * caret and moving to the end of the word. Emulates the Emacs "downcase-word"
+ * function.
+ */
+
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsDowncaseWord()
+{
+    caret = eatNonAlphanums();
+
+    textArea.goToNextWord (false);
+    endOfWord = textArea.getCaretPosition();
+
+    textArea.setCaretPosition (caret);
+    selection = new Selection.Range (caret, endOfWord);
+    textArea.setSelection (selection);
+    textArea.toLowerCase();
+}
+
+emacsDowncaseWord();
+
diff --git a/macros/Emacs/Emacs_Exchange_Point_and_Mark.bsh b/macros/Emacs/Emacs_Exchange_Point_and_Mark.bsh
new file mode 100644
index 0000000..5654b88
--- /dev/null
+++ b/macros/Emacs/Emacs_Exchange_Point_and_Mark.bsh
@@ -0,0 +1,21 @@
+/**
+ * Emulate GNU Emacs's "exchange-point-and-mark" capability.
+ * Does NOT use jEdit markers.
+ */
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsExchangePointAndMark()
+{
+    int mark = getMark (buffer);
+    if (mark == -1)
+    {
+        beep();
+        return;
+    }
+    int point = textArea.getCaretPosition();
+    setMark (buffer, point);
+    textArea.setCaretPosition (mark);
+}
+
+emacsExchangePointAndMark();
+
diff --git a/macros/Emacs/Emacs_Fixup_Whitespace.bsh b/macros/Emacs/Emacs_Fixup_Whitespace.bsh
new file mode 100644
index 0000000..7a9bb97
--- /dev/null
+++ b/macros/Emacs/Emacs_Fixup_Whitespace.bsh
@@ -0,0 +1,92 @@
+/**
+ * Emulate GNU Emacs's (fixup-whitespace) function (typically bound to
+ * Ctrl-SPACE. Not a complete emulation. Emacs docs for this function:
+ *
+ *     Fixup white space between objects around caret.
+ *     Leave one space or none, according to the context.
+ */
+
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsFixupWhitespace()
+{
+    caret = textArea.getCaretPosition();
+    caretLine = textArea.getCaretLine();
+    lineStart = textArea.getLineStartOffset (caretLine);
+    lineEnd = textArea.getLineEndOffset (caretLine);
+           
+    // Determine whether there's white space at the caret.
+    
+    ch = charAtCaret();
+    chPrev = '\0';
+    if (caret > lineStart)
+        chPrev = charAt (caret - 1);
+
+    if (Character.isWhitespace (ch) || Character.isWhitespace (chPrev))
+    {
+        // Collapse white space behind and in front of caret, leaving just
+        // one. NOTE: For compatibility with Emacs,p if the caret is in the
+        // first column, we don't leave any spaces.
+
+        // First, the characters behind the caret:
+        
+        if (Character.isWhitespace (chPrev))
+        {
+            origCaret = caret;
+            caret = caret--;
+            textArea.goToPrevCharacter (false);
+            chPrev = charAtCaret();
+            while ((caret > lineStart) && (Character.isWhitespace (chPrev)))
+            {
+                textArea.delete();
+                caret = caret - 1;
+                textArea.goToPrevCharacter (false);
+                chPrev = charAtCaret();
+            }
+            
+            // Caret is now one character behind where we want it.
+            
+            textArea.goToNextCharacter (false);
+        }
+
+        if (Character.isWhitespace (ch) && (ch != '\n'))
+        {
+            ch = charAtCaret();
+            while ((caret <= lineEnd) &&
+                (Character.isWhitespace (ch)) &&
+                (ch != '\n'))
+            {
+                textArea.delete();
+                ch = charAtCaret();
+                caret = textArea.getCaretPosition();
+            }
+ 
+            // Make sure there's one blank left--unless:
+            //
+            // a) we're in column 1, or
+            // b) the next character is not a letter or digit, or
+            // c) the previous character is not a letter or digit.
+
+           if (caret > lineStart)
+            {
+                chPrev = charAt (caret - 1);
+
+                if (Character.isLetterOrDigit (ch) &&
+                    Character.isLetterOrDigit (chPrev))
+                {
+                    buffer.insert (caret, " ");
+                }
+            }
+        }
+    }
+ 
+    else if ((caret + 1) != lineEnd)
+    {
+        // Insert one blank.
+ 
+        buffer.insert (caret, " ");
+    }
+}
+
+emacsFixupWhitespace();
+
diff --git a/macros/Emacs/Emacs_Forward_Sentence.bsh b/macros/Emacs/Emacs_Forward_Sentence.bsh
new file mode 100644
index 0000000..801a5cc
--- /dev/null
+++ b/macros/Emacs/Emacs_Forward_Sentence.bsh
@@ -0,0 +1,13 @@
+/**
+ * Go to the end of the current sentence. Emulates the Emacs "forward-sentence"
+ * command.
+ */
+
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsForwardSentence()
+{
+    textArea.setCaretPosition (findEndOfSentence());
+}
+
+emacsForwardSentence();
diff --git a/macros/Emacs/Emacs_Insert_File.bsh b/macros/Emacs/Emacs_Insert_File.bsh
new file mode 100644
index 0000000..eac921a
--- /dev/null
+++ b/macros/Emacs/Emacs_Insert_File.bsh
@@ -0,0 +1,21 @@
+/**
+ * Insert the contents of a file at the caret. Emulates the Emacs
+ * "insert-file" command (normally bound to "Ctrl-X i").
+ */
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsInsertFile()
+{
+    caret = textArea.getCaretPosition();
+    
+    path = buffer.getPath();
+    if (path == null)
+        path = ".";
+    else
+        path = dirname (path);
+    result = GUIUtilities.showVFSFileDialog(view, path, VFSBrowser.OPEN_DIALOG, false);
+    if (result != null)
+        buffer.insertFile (view, result[0]);
+}
+
+emacsInsertFile();
diff --git a/macros/Emacs/Emacs_Kill_Line.bsh b/macros/Emacs/Emacs_Kill_Line.bsh
new file mode 100644
index 0000000..60ef008
--- /dev/null
+++ b/macros/Emacs/Emacs_Kill_Line.bsh
@@ -0,0 +1,75 @@
+/**
+ * Emulate GNU Emacs's (kill-line) function (typically bound to Ctrl-K)
+ */
+
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsKillLine()
+{
+    boolean lastActionWasThis = repeatingSameMacro ("Emacs/Emacs_Kill_Line");
+
+    caret = textArea.getCaretPosition();
+    caretLine = textArea.getCaretLine();
+    lineStart = textArea.getLineStartOffset (caretLine);
+    lineEnd = textArea.getLineEndOffset (caretLine);
+
+    // If we're at the end of line (ignoring any trailing white space),
+    // then kill the newline, too.
+    
+    caret2 = caret + 1;
+    while (caret2 < lineEnd)
+    {
+        ch = charAt (caret2);
+        
+        if (! Character.isWhitespace (ch))
+            break;
+
+        caret2++;
+    }
+
+    String deletedText = null;
+    Selection selection = null;
+
+    if (caret2 == lineEnd)
+    {
+        // We're at the end of the line. Join this line and the next line--but
+        // do it with a true delete, not with textArea.joinLines(), to
+        // emulate emacs better.
+
+        if (caretLine != textArea.getLastPhysicalLine())
+            selection = new Selection.Range (caret, caret2);
+    }
+
+    else
+    {
+        // Simple delete to end of line.
+
+        selection = new Selection.Range (caret, lineEnd - 1);
+        //textArea.deleteToEndOfLine();
+    }
+
+    if (selection != null)
+    {
+        textArea.setSelection (selection);
+        deletedText = textArea.getSelectedText();
+        textArea.replaceSelection ("");
+        textArea.removeFromSelection (selection);
+
+        if (lastActionWasThis)
+        {
+            clipboard = getClipboard();
+            if (clipboard == null)
+                clipboard = "";
+
+            setClipboard (clipboard + deletedText);
+        }
+
+        else
+        {
+            setClipboard (deletedText);
+        }
+    }
+}
+
+emacsKillLine();
+
diff --git a/macros/Emacs/Emacs_Kill_Region.bsh b/macros/Emacs/Emacs_Kill_Region.bsh
new file mode 100644
index 0000000..3ab2e7e
--- /dev/null
+++ b/macros/Emacs/Emacs_Kill_Region.bsh
@@ -0,0 +1,27 @@
+/**
+ * Emulate GNU Emacs's "kill-region" capability (normally bound to Ctrl-W),
+ * which kills the text between the caret and the mark, copying it to the kill
+ * ring. This version is slightly different: If there's any selected text, it
+ * kills and copies that text. Otherwise, it selects the text between the
+ * caret and the mark, and kills and copies that.
+ *
+ * Does NOT use jEdit markers.
+ */
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsKillRegion()
+{
+    selection = getKillRegion();
+    if (selection == null)
+        beep();
+
+    else
+    {
+        addToClipboardAndHistory (selection);
+        textArea.replaceSelection ("");
+        textArea.removeFromSelection (selection);
+    }
+}
+
+emacsKillRegion();
+
diff --git a/macros/Emacs/Emacs_Kill_Ring_Save.bsh b/macros/Emacs/Emacs_Kill_Ring_Save.bsh
new file mode 100644
index 0000000..92002d3
--- /dev/null
+++ b/macros/Emacs/Emacs_Kill_Ring_Save.bsh
@@ -0,0 +1,22 @@
+/**
+ * Emulate GNU Emacs's "kill-ring-save" capability (normally bound to Meta-W),
+ * which copies the text between the caret and the mark to the kill ring. This 
+ * version is slightly different than the Emacs version: If there's any
+ * selected text, it copies that text. Otherwise, it selects the text between
+ * the caret and the mark, and copies that.
+ *
+ * Does NOT use jEdit markers.
+ */
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsKillRingSave()
+{
+    selection = getKillRegion();
+    if (selection == null)
+        beep();
+    else
+        addToClipboardAndHistory (selection);
+}
+
+emacsKillRingSave();
+
diff --git a/macros/Emacs/Emacs_Kill_Sentence.bsh b/macros/Emacs/Emacs_Kill_Sentence.bsh
new file mode 100644
index 0000000..802d6fc
--- /dev/null
+++ b/macros/Emacs/Emacs_Kill_Sentence.bsh
@@ -0,0 +1,20 @@
+/**
+ * Kill to the end of the current sentence. Emulates the Emacs "kill-sentence"
+ * command.
+ */
+
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsKillSentence()
+{
+    caret = textArea.getCaretPosition();
+    eos = findEndOfSentence();
+
+    selection = new Selection.Range (caret, eos);
+    textArea.setSelection (selection);
+    addToClipboardAndHistory (selection);
+    textArea.replaceSelection ("");
+    textArea.removeFromSelection (selection);
+}
+
+emacsKillSentence();
diff --git a/macros/Editing/Emacs_Next_Line.bsh b/macros/Emacs/Emacs_Next_Line.bsh
similarity index 95%
rename from macros/Editing/Emacs_Next_Line.bsh
rename to macros/Emacs/Emacs_Next_Line.bsh
index afc1c16..ad98075 100644
--- a/macros/Editing/Emacs_Next_Line.bsh
+++ b/macros/Emacs/Emacs_Next_Line.bsh
@@ -7,7 +7,7 @@
  *
  * Copyright (C) 2002-2004, Ollie Rutherfurd <oliver at rutherfurd.net>
  *
- * $Id: Emacs_Next_Line.bsh 4995 2004-03-19 15:58:00Z spestov $
+ * $Id: Emacs_Next_Line.bsh 22257 2012-09-27 20:22:23Z ezust $
  */
 
 void emacsNextLine(View view){
diff --git a/macros/Emacs/Emacs_Open_Line.bsh b/macros/Emacs/Emacs_Open_Line.bsh
new file mode 100644
index 0000000..7bcf328
--- /dev/null
+++ b/macros/Emacs/Emacs_Open_Line.bsh
@@ -0,0 +1,18 @@
+/**
+ * Insert a newline after the caret, without moving the caret. This macro
+ * corresponds to the Emacs (open-line) capability.
+ */
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsOpenLine()
+{
+    caret = textArea.getCaretPosition();
+    buffer.insert (caret, "\n");
+    // Caret moved. Back it up.
+    textArea.goToPrevLine (false);
+    textArea.goToEndOfLine (false);
+}
+
+emacsOpenLine();
+
+
diff --git a/macros/Editing/Emacs_Previous_Line.bsh b/macros/Emacs/Emacs_Previous_Line.bsh
similarity index 95%
rename from macros/Editing/Emacs_Previous_Line.bsh
rename to macros/Emacs/Emacs_Previous_Line.bsh
index de86c02..dac774a 100644
--- a/macros/Editing/Emacs_Previous_Line.bsh
+++ b/macros/Emacs/Emacs_Previous_Line.bsh
@@ -7,7 +7,7 @@
  *
  * Copyright (C) 2002-2004, Ollie Rutherfurd <oliver at rutherfurd.net>
  *
- * $Id: Emacs_Previous_Line.bsh 4995 2004-03-19 15:58:00Z spestov $
+ * $Id: Emacs_Previous_Line.bsh 22257 2012-09-27 20:22:23Z ezust $
  */
 
 void emacsPreviousLine(View view){
diff --git a/macros/Emacs/Emacs_Set_Mark.bsh b/macros/Emacs/Emacs_Set_Mark.bsh
new file mode 100644
index 0000000..5c2dce0
--- /dev/null
+++ b/macros/Emacs/Emacs_Set_Mark.bsh
@@ -0,0 +1,15 @@
+/**
+ * Emulate GNU Emacs's "set-mark-command" capability.
+ * Does NOT use jEdit markers.
+ */
+source (dirname (scriptPath) +
+        System.getProperty ("file.separator") +
+        "EmacsUtil.bsh");
+
+void emacsSetMark()
+{
+    setMark (buffer, textArea.getCaretPosition());
+}
+
+emacsSetMark();
+
diff --git a/macros/Emacs/Emacs_Set_Wrap.bsh b/macros/Emacs/Emacs_Set_Wrap.bsh
new file mode 100644
index 0000000..5f5b8de
--- /dev/null
+++ b/macros/Emacs/Emacs_Set_Wrap.bsh
@@ -0,0 +1,57 @@
+/**
+ * Emulates the Emacs "set-fill-column" command, except that it prompts
+ * for the new fill column instead of using an Emacs-style "prefix argument."
+ */
+
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsSetWrap()
+{
+    // Convert the buffer name into a property name.
+
+    propName = makeBufferPropertyName ("emacs.fillColumn.");
+    
+    // Get a value from the user.
+    
+    String err = "";
+    int defaultWrap = getCardinalProperty (propName, getDefaultWrap());
+    for (;;)
+    {
+        String s = Macros.input (editPane,
+                                 err +
+                                 "Enter new fill column or 0 to " +
+                                 "reset to default",
+                                 String.valueOf (defaultWrap));
+        if (s == null)
+            break;
+
+        // Try to parse it.
+
+        try
+        {
+            int i = Integer.parseInt (s);
+
+            if ((i == 0) || (i == defaultWrap))
+            {
+                jEdit.unsetProperty (propName);
+                break;
+            }
+
+            if (i > 0)
+            {
+                jEdit.setIntegerProperty (propName, i);
+                break;
+            }
+
+            err = "Bad fill column value. ";
+       }
+
+       catch (NumberFormatException ex)
+       {
+           err = "Bad fill column value. ";
+       }
+    }
+}
+
+emacsSetWrap();
+
diff --git a/macros/Emacs/Emacs_Transpose_Chars.bsh b/macros/Emacs/Emacs_Transpose_Chars.bsh
new file mode 100644
index 0000000..8cd6ab0
--- /dev/null
+++ b/macros/Emacs/Emacs_Transpose_Chars.bsh
@@ -0,0 +1,27 @@
+/**
+ * Transpose character at caret with previous character, and move caret
+ * forward one. Emulates Emacs "transpose-chars" command (without prefix
+ * argument support).
+ */
+
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsTransposeChars()
+{
+    caret = textArea.getCaretPosition();
+    if ((caret == 0) || atEndOfBuffer())
+    {
+        beep();
+        return;
+    }
+
+    char chCur = charAtCaret();
+    char chPrev = charAt (caret - 1);
+    selection = new Selection.Range (caret - 1, caret + 1);
+    textArea.setSelection (selection);
+    textArea.setSelectedText (new String ("" + chCur + chPrev));
+    textArea.removeFromSelection (selection);
+}
+
+emacsTransposeChars();
+
diff --git a/macros/Emacs/Emacs_Transpose_Lines.bsh b/macros/Emacs/Emacs_Transpose_Lines.bsh
new file mode 100644
index 0000000..e0fe7f2
--- /dev/null
+++ b/macros/Emacs/Emacs_Transpose_Lines.bsh
@@ -0,0 +1,45 @@
+/**
+ * Transpose line at caret with previous line, and move caret to next line.
+ *  Emulates Emacs "transpose-lines" command (without prefix argument support).
+ */
+
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsTransposeLines()
+{
+    caret = textArea.getCaretPosition();
+    if ((caret == 0) || atEndOfBuffer())
+    {
+        beep();
+        return;
+    }
+
+    caretLine = textArea.getCaretLine();
+    lineStart = textArea.getLineStartOffset (caretLine);
+    lineEnd = textArea.getLineEndOffset (caretLine);
+    lineIndex = textArea.getLineOfOffset (caretLine);
+
+    selection = new Selection.Range (lineStart, lineEnd);
+    line = textArea.getSelectedText(selection);
+
+    // Get the location of the previous line
+
+    textArea.goToPrevLine (false);
+    prevLineCaret = textArea.getCaretLine();
+    prevLineStart = textArea.getLineStartOffset (prevLineCaret);
+
+    // Go back to the original location.
+    
+    textArea.setCaretPosition (caret);
+    
+    // Delete the line
+    
+    textArea.deleteLine();
+    
+    // Insert it in the new location.
+
+    buffer.insert (prevLineStart, line);
+}
+
+emacsTransposeLines();
+
diff --git a/macros/Emacs/Emacs_Upcase_Word.bsh b/macros/Emacs/Emacs_Upcase_Word.bsh
new file mode 100644
index 0000000..973a5e6
--- /dev/null
+++ b/macros/Emacs/Emacs_Upcase_Word.bsh
@@ -0,0 +1,23 @@
+/**
+ * Convert the portion of the current word to upper case, starting at the
+ * caret and moving to the end of the word. Emulates the Emacs "upcase-word"
+ * function.
+ */
+
+source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+
+void emacsUpcaseWord()
+{
+    caret = eatNonAlphanums();
+
+    textArea.goToNextWord (false);
+    endOfWord = textArea.getCaretPosition();
+
+    textArea.setCaretPosition (caret);
+    selection = new Selection.Range (caret, endOfWord);
+    textArea.setSelection (selection);
+    textArea.toUpperCase();
+}
+
+emacsUpcaseWord();
+ 
diff --git a/macros/Emacs/LICENSE.md b/macros/Emacs/LICENSE.md
new file mode 100644
index 0000000..dd7bd22
--- /dev/null
+++ b/macros/Emacs/LICENSE.md
@@ -0,0 +1,36 @@
+---
+title: License for the jEdit Emacs Macros
+layout: default
+---
+
+This software is released under a BSD license, adapted from
+<http://opensource.org/licenses/bsd-license.php>
+
+Copyright © 2005-2010 Brian M. Clapper.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+  this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+* Neither the name "clapper.org" nor the names of its contributors may be
+  used to endorse or promote products derived from this software without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/macros/Emacs/README.md b/macros/Emacs/README.md
new file mode 100644
index 0000000..8ce19a4
--- /dev/null
+++ b/macros/Emacs/README.md
@@ -0,0 +1,27 @@
+Emacs Macros for JEdit
+======================
+
+## Introduction
+
+This repository contains a set of key bindings and some BeanShell macros
+for the popular [jEdit][] editor. The key bindings and macros, together,
+attempt to provide a better emulation of the GNU Emacs editor than is
+available out of the box with jEdit. Some of the key bindings in the
+shortcuts file merely bind to existing jEdit macros; however, others bind
+to macros provided by this package.
+
+For more information, see the accompanying [web site][].
+
+## Copyright and License
+
+These macros are copyright © 2005-2011 Brian M. Clapper and are
+released under a BSD license.
+
+## Notes
+
+**NOTICE** This emulation software is not part of, or endorsed by, the GNU
+Emacs project or the Free Software Foundation, nor is it a part of, or
+endorsed by, the jEdit project.
+
+[jEdit]: http://jedit.org/
+[web site]: http://software.clapper.org/jedit-emacs/
diff --git a/macros/Files/Close_All_Except_Active.bsh b/macros/Files/Close_All_Except_Active.bsh
deleted file mode 100644
index db9fb1a..0000000
--- a/macros/Files/Close_All_Except_Active.bsh
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Close_All_Except_Active.bsh - a BeanShell macro script for the
- * jEdit text editor - Closes all except the current active buffer
- * Copyright (C) 2001 John Gellene
- * jgellene at nyc.rr.com
- * http://community.jedit.org
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * $Id: Close_All_Except_Active.bsh 3871 2001-11-06 17:15:01Z jgellene $
- *
- * Checked for jEdit 4.0 API
- *
- */
-
-void closeBuffersExceptActive()
-{
-	buffers = jEdit.getBuffers();
-	for(i = 0; i < buffers.length; ++i)
-	{
-		if(buffers[i] != buffer)
-			jEdit.closeBuffer(view, buffers[i]);
-	}
-}
-
-closeBuffersExceptActive();
-
-/*
-	Macro index data (in DocBook format)
-
-<listitem>
-    <para><filename>Close_Except_Active.bsh</filename></para>
-    <abstract><para>
-        Closes all files except the current buffer.
-    </para></abstract>
-    <para>
-        Prompts the user to save any buffer containing unsaved changes.
-    </para>
-</listitem>
-
-*/
-
-
-// end Close_Except_Active.bsh
-
diff --git a/macros/Files/Glob_Close.bsh b/macros/Files/Glob_Close.bsh
index 8fce428..f78f358 100644
--- a/macros/Files/Glob_Close.bsh
+++ b/macros/Files/Glob_Close.bsh
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 2003-2004 Ollie Rutherfurd <oliver at rutherfurd.net>
  *
- * $Id: Glob_Close.bsh 22348 2012-10-11 12:27:46Z kpouer $
+ * $Id: Glob_Close.bsh 22276 2012-09-29 11:59:27Z kerik-sf $
  */
 
 import java.util.regex.Pattern;
diff --git a/macros/Files/Insert_Selection.bsh b/macros/Files/Insert_Selection.bsh
index 1385990..3039126 100644
--- a/macros/Files/Insert_Selection.bsh
+++ b/macros/Files/Insert_Selection.bsh
@@ -7,7 +7,7 @@
  *
  * Copyright (C) 2004 Ollie Rutherfurd <oliver at jedit.org>
  *
- * $Id: Insert_Selection.bsh 5037 2004-05-06 22:35:11Z spestov $
+ * $Id: Insert_Selection.bsh 22845 2013-03-16 08:28:12Z thomasmey $
  */
 
 insertSelected(View view, String path){
@@ -24,17 +24,17 @@ insertSelected(View view, String path){
 		view.getTextArea().setSelectedText(text);
 	}finally{
 		if(b != null)
-			b.close();
+			jEdit._closeBuffer(null, b);
 	}
 }
 
 if(buffer.isReadOnly()){
-	getToolkit().beep();
+	Toolkit.getDefaultToolkit().beep();
 }
 else{
 	String selected = view.getTextArea().getSelectedText();
 	if(selected == null || selected.indexOf('\n') != -1)
-		getToolkit().beep();
+		Toolkit.getDefaultToolkit().beep();
 	else
 		insertSelected(view,selected);
 }
diff --git a/macros/Files/Open_Selection.bsh b/macros/Files/Open_Selection.bsh
index c6cbdc6..308fc1e 100644
--- a/macros/Files/Open_Selection.bsh
+++ b/macros/Files/Open_Selection.bsh
@@ -2,6 +2,7 @@
  * Open_Selection.bsh - a BeanShell macro script for the
  * jEdit text editor - opens file named by selected text
  * Copyright (C) 2001 Slava Pestov
+ * Copyright (C) 2012 Jarek Czekalski
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -17,38 +18,142 @@
  * along with the jEdit program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: Open_Selection.bsh 4826 2003-07-14 23:00:54Z spestov $
+ * $Id: Open_Selection.bsh 22299 2012-10-04 11:43:29Z jarekczek $
  *
  * Checked for jEdit 4.0 API
  *
  */
 
-void openSelection()
+String getBrowserPath() //{{{
+{
+	// copied from VFSBrowser constructor
+	// in 5.1 there will be VFSBrowser.getLastVisitedPath() api for that
+	HistoryModel pathModel = HistoryModel.getModel("vfs.browser.path");
+	if(pathModel.getSize() == 0)
+		return null;
+	else
+		return pathModel.getItem(0);
+} //}}}
+
+// tryPath function {{{
+/** tryPath
+ * Tries to open a file built as concatenation of <code>sParent</code>
+ * and <code>sPath</code> paths. If file does not exist, no action is done.
+ * @return <code>true</code> if file exists, <code>false</code> otherwise.
+ */
+boolean tryPath(String sParent, String sPath)
 {
-	Selection[] selection = textArea.getSelection();
-	if(selection == null)
-		view.getToolkit().beep();
+	File f = new File(sParent, sPath);
+	if (f.exists())
+	{
+		jEdit.openFile(view, f.getPath());
+		return true;
+	}
 	else
 	{
-		for(i = 0; i < selection.length; i++)
-			jEdit.openFile(view,textArea.getSelectedText(selection[i]));
+		return false;
+	}
+} //}}}
+
+// getNoWordSep function {{{
+/**
+ * Inverts the list of word break chars to get the list of word
+ * separators. Ascii only space is assumed.
+ */
+String getNoWordSep(String sWordBreakChars)
+{
+    StringBuilder sb = new StringBuilder();
+    for (char c = 33; c <= 126; c++)
+    {
+        if (!Character.isLetterOrDigit(c)
+            && sWordBreakChars.indexOf(c) < 0)
+        {
+            sb.append(c);
+        }
+    }
+    return sb.toString();
+} //}}}
+
+// getSelectedWords function {{{
+/**
+ * Returns an array of selected words, assuming that user selected
+ * words (not whitespaces). If nothing is selected, returns
+ * the word under the caret, using custom word break chars.
+ */
+String[] getSelectedWords()
+{
+    String sWordBreakChars = "\"\'";
+    ArrayList words = new ArrayList();
+    Selection[] sels = textArea.getSelection();
+    for (Selection sel: sels)
+        words.add(textArea.getSelectedText(sel));
+    if (words.size() == 0)
+    {
+        // we need to get the word under caret, as nothing is selected
+        // we use the same rules as in TextArea.selectWord
+        int nLine = textArea.getCaretLine();
+        CharSequence line = buffer.getLineSegment(nLine);
+        int nStartPos = textArea.getCaretPosition()
+                        - buffer.getLineStartOffset(nLine);
+
+        // cannot read any char if at line end, so:
+        if (nStartPos == line.length())
+            nStartPos--;
+
+        // findWordStart/End utilities expect noWordSep, but we have
+        /// a list of word separators - so invert it
+        String sNoWordSep = getNoWordSep(sWordBreakChars);
+
+        int nLeft = TextUtilities.findWordStart(
+            line, nStartPos, sNoWordSep);
+        int nRight = TextUtilities.findWordEnd(
+            line, nStartPos+1, sNoWordSep);
+        if (nRight - nLeft < 1)
+        {
+            // javax.swing.JOptionPane.showMessageDialog(null,
+                // "start: " + nLeft + ", end: " + nRight);
+            view.getToolkit().beep();
+        }
+        else
+            words.add(String.valueOf(line.subSequence(nLeft, nRight)));
+    }
+    return words.toArray(new String[0]);
+} //}}}
+
+// openSelection function {{{
+/**
+ * Tries to find an existing file using current java directory and
+ * last browser directory as parents of the filename contained
+ * in selection. If this succeeds, the file is opened.
+ * Otherwise direct <code>jEdit.openFile</code> call is done on selection.
+ */
+void openSelection()
+{
+	for (String sPath: getSelectedWords())
+	{
+		if (!tryPath("", sPath) &&
+			!tryPath(getBrowserPath(), sPath))
+		{
+			jEdit.openFile(view, sPath);
+		}
 	}
-}
+} //}}}
 
 openSelection();
 
-/*
-	Macro index data (in DocBook format)
+/* Macro index data (in DocBook format) {{{
+
+            <listitem>
+                <para><filename>Open_Selection.bsh</filename></para>
 
-<listitem>
-    <para><filename>Open_Selection.bsh</filename></para>
-    <abstract><para>
-        Opens the file named by the current buffer's selected text.
-    </para></abstract>
-</listitem>
+                <para>Opens the file named by the current buffer's selected
+                text. Current VFS browser directory is also tried as
+                a parent of the filename, but only as a local path.</para>
+            </listitem>
 
-*/
+}}} */
 
 
 // end Open_Selection.bsh
 
+// :noTabs=false:tabSize=4:indentSize=4:folding=explicit:
diff --git a/macros/Files/Open_Selection_In_Desktop.bsh b/macros/Files/Open_Selection_In_Desktop.bsh
new file mode 100644
index 0000000..4894897
--- /dev/null
+++ b/macros/Files/Open_Selection_In_Desktop.bsh
@@ -0,0 +1,106 @@
+/*
+ * jEdit text editor: a macro that opens in desktop the selected text
+ * or the word under caret
+ *
+ * Copyright (C) 2012 Jarek Czekalski <jarekczek at poczta.onet.pl>
+ *
+ * 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 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 the jEdit program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// getNoWordSep function {{{
+/**
+ * Inverts the list of word break chars to get the list of word
+ * separators. Ascii only space is assumed.
+ */
+String getNoWordSep(String sWordBreakChars)
+{
+    StringBuilder sb = new StringBuilder();
+    for (char c = 33; c <= 126; c++)
+    {
+        if (!Character.isLetterOrDigit(c)
+            && sWordBreakChars.indexOf(c) < 0)
+        {
+            sb.append(c);
+        }
+    }
+    return sb.toString();
+} ///}}}
+
+// getSelectedWords function {{{
+/**
+ * Returns an array of selected words, assuming that user selected
+ * words (not whitespaces). If nothing is selected, returns
+ * the word under the caret, using custom word break chars.
+ */
+String[] getSelectedWords()
+{
+    String sWordBreakChars = "\"\'";
+    ArrayList words = new ArrayList();
+    Selection[] sels = textArea.getSelection();
+    for (Selection sel: sels)
+        words.add(textArea.getSelectedText(sel));
+    if (words.size() == 0)
+    {
+        // we need to get the word under caret, as nothing is selected
+        // we use the same rules as in TextArea.selectWord
+        int nLine = textArea.getCaretLine();
+        CharSequence line = buffer.getLineSegment(nLine);
+        int nStartPos = textArea.getCaretPosition()
+                        - buffer.getLineStartOffset(nLine);
+
+        // cannot read any char if at line end, so:
+        if (nStartPos == line.length())
+            nStartPos--;
+
+        // findWordStart/End utilities expect noWordSep, but we have
+        /// a list of word separators - so invert it
+        String sNoWordSep = getNoWordSep(sWordBreakChars);
+
+        int nLeft = TextUtilities.findWordStart(
+            line, nStartPos, sNoWordSep);
+        int nRight = TextUtilities.findWordEnd(
+            line, nStartPos+1, sNoWordSep);
+        if (nRight - nLeft < 1)
+        {
+            // javax.swing.JOptionPane.showMessageDialog(null,
+                // "start: " + nLeft + ", end: " + nRight);
+            view.getToolkit().beep();
+        }
+        else
+            words.add(String.valueOf(line.subSequence(nLeft, nRight)));
+    }
+    return words.toArray(new String[0]);
+} //}}}
+
+for (String sPath: getSelectedWords())
+{
+    URI uri;
+    String sScheme = null;
+    try {
+        uri = new URI(sPath);
+        sScheme = uri.getScheme();
+    }
+    catch (URISyntaxException se) {}
+
+    // javax.swing.JOptionPane.showMessageDialog(null, "_" + sPath + "_");
+    // continue;
+
+    if (sScheme != null && sScheme.length() > 0)
+        java.awt.Desktop.getDesktop().browse(uri);
+    else
+        MiscUtilities.openInDesktop(sPath);
+}
+
+// :tabSize=4:indentSize=4:noTabs=true:folding=explicit:collapseFolds=1:
diff --git a/macros/Java/Get_Class_Name.bsh b/macros/Java/Get_Class_Name.bsh
index 1883058..91a035e 100644
--- a/macros/Java/Get_Class_Name.bsh
+++ b/macros/Java/Get_Class_Name.bsh
@@ -105,7 +105,7 @@ String getClassName()
   setCaret(selectionStart, selectionEnd);
   
   String className = buffer.getName();
-  int index = name.lastIndexOf('.');
+  int index = className.lastIndexOf('.');
   if(index != -1)
   {
     className = className.substring(0, index);
diff --git a/macros/Misc/Display_Abbreviations.bsh b/macros/Misc/Display_Abbreviations.bsh
index 88cda09..9eb949c 100644
--- a/macros/Misc/Display_Abbreviations.bsh
+++ b/macros/Misc/Display_Abbreviations.bsh
@@ -19,7 +19,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: Display_Abbreviations.bsh 21959 2012-07-28 23:26:04Z ezust $
+ * $Id: Display_Abbreviations.bsh 21917 2012-07-03 12:10:15Z kpouer $
  *
  * requires JDK 1.2, jEdit3.0
  *
diff --git a/macros/Misc/Generate Encodings List.bsh b/macros/Misc/Generate Encodings List.bsh
new file mode 100644
index 0000000..e2aaf3a
--- /dev/null
+++ b/macros/Misc/Generate Encodings List.bsh	
@@ -0,0 +1,32 @@
+import org.gjt.sp.jedit.io.EncodingServer;
+
+/** Generates 'encodingsList.html' page for jedit.org containing the encodings list. */ 
+
+nameSet = EncodingServer.getAvailableNames();
+sbuffer = new StringBuffer();
+
+htmlBuffer = jEdit.openFile(editPane, "encodingsList.html");
+editPane.setBuffer(htmlBuffer);
+itr = nameSet.iterator();
+int i=0;
+sbuffer.append("<html><head><title> Supported jEdit Encodings </title></head>\n");
+sbuffer.append("<!--    :elasticTabstops=true: -->\n");
+sbuffer.append("<body><h2> Supported jEdit Encodings: " + nameSet.size() + "</h2>\n ");
+sbuffer.append("<table><tbody><tr>\n");
+while (itr.hasNext()) {
+    i++;
+    enc = itr.next();
+    sbuffer.append("\t<td>" + enc + "</td>");
+    if (i%5==0) sbuffer.append("  </tr><tr>\n");
+}
+sbuffer.append("</tr></tbody></table>\n");
+sbuffer.append("<p>Using jEdit " + jEdit.getVersion() + " on " + new Date() + " with ");
+sbuffer.append(System.getProperty("java.vendor") + " Java " + System.getProperty("java.version") + " on " + System.getProperty("os.name") + " " + System.getProperty("os.version") + "\n");
+sbuffer.append(" Generated from macro <tt>" + scriptPath + "</tt> </p>");
+
+sbuffer.append("</body></html>\n");
+
+htmlBuffer.insert(0, sbuffer.toString());
+// set elastic tabstops for this one. 
+
+htmlBuffer.setBooleanProperty("elasticTabstops", true);
\ No newline at end of file
diff --git a/macros/Misc/Generate Modes List.bsh b/macros/Misc/Generate Modes List.bsh
new file mode 100644
index 0000000..189101c
--- /dev/null
+++ b/macros/Misc/Generate Modes List.bsh	
@@ -0,0 +1,27 @@
+import org.gjt.sp.jedit.io.EncodingServer;
+
+/** Generates editModeList.html page for jedit.org website listing the encodings supported by jEdit. */
+
+modeList = jEdit.getModes();
+sbuffer = new StringBuffer();
+htmlBuffer = jEdit.openFile(editPane, "editModeList.html");
+editPane.setBuffer(htmlBuffer);
+
+sbuffer.append("<html><head><title> Supported jEdit Edit Modes </title></head>\n");
+sbuffer.append("<!--    :elasticTabstops=true: -->\n");
+sbuffer.append("<body>\n<h3> Supported Languages/File Types in jEdit" + jEdit.getVersion() + ": " + modeList.length + "</h3>\n ");
+sbuffer.append("<table><tbody><tr>\n");
+for (int i=0; i<modeList.length; ++i) {
+    mode = modeList[i];
+    sbuffer.append("\t<td>" + mode.toString() + "</td>");
+    if ((i+1)%6==0) sbuffer.append("  </tr><tr>\n");
+}
+sbuffer.append("</tr></tbody></table>\n <p>");
+sbuffer.append(" Generated from macro <tt>" + scriptPath + "</tt> </p>");
+
+sbuffer.append("\n</body></html>\n");
+
+htmlBuffer.insert(0, sbuffer.toString());
+// set elastic tabstops for this one. 
+
+htmlBuffer.setBooleanProperty("elasticTabstops", true);
\ No newline at end of file
diff --git a/macros/Misc/Insert Plugins List.bsh b/macros/Misc/Insert Plugins List.bsh
new file mode 100644
index 0000000..7610a1e
--- /dev/null
+++ b/macros/Misc/Insert Plugins List.bsh	
@@ -0,0 +1,21 @@
+
+/** Inserts a list of the currently running plugins into the current buffer. */
+
+sbuffer = new StringBuffer();
+sbuffer.append("Using jEdit " + jEdit.getVersion() + " on " + new Date() + "\n");
+sbuffer.append("Currently running plugins: \n\n");
+
+pluginJARs = jEdit.getPluginJARs();
+int numJars = pluginJARs.length;
+for (int i=0; i<numJars; ++i) {
+    jar = pluginJARs[i];
+    plugin = jar.getPlugin();
+    if (plugin == null) continue;
+    className = plugin.getClass().getName();
+    String label = jEdit.getProperty("plugin." + className + ".name");
+    if (label == null) continue;
+    String version = jEdit.getProperty("plugin." + className + ".version");
+    sbuffer.append("  " + label + " " + version + " (" + className + ")" +  "\n");
+}
+sbuffer.append("\n\n Using macro " + scriptPath + "\n");
+buffer.insert(textArea.getCaretPosition(), sbuffer.toString());
diff --git a/macros/Misc/Make_Bug_Report.bsh b/macros/Misc/Make_Bug_Report.bsh
index d26d548..406bc4a 100644
--- a/macros/Misc/Make_Bug_Report.bsh
+++ b/macros/Misc/Make_Bug_Report.bsh
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: Make_Bug_Report.bsh 21353 2012-03-14 09:46:51Z jojaba_67 $
+ * $Id: Make_Bug_Report.bsh 22015 2012-08-17 08:27:45Z kpouer $
  *
  * Checked for jEdit 4.0 API
  *
@@ -101,6 +101,7 @@ makeBugReport()
 	report.append(lastError.toString());
 	newBuffer = jEdit.newFile(view);
 	newBuffer.insert(0, report.toString());
+	newBuffer.setMode(jEdit.getMode("logs"));
 }
 
 makeBugReport();
diff --git a/macros/Misc/Run_Script.bsh b/macros/Misc/Run_Script.bsh
index f3aae69..5347459 100644
--- a/macros/Misc/Run_Script.bsh
+++ b/macros/Misc/Run_Script.bsh
@@ -21,7 +21,7 @@
  * along with the jEdit program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: Run_Script.bsh 21353 2012-03-14 09:46:51Z jojaba_67 $
+ * $Id: Run_Script.bsh 22582 2012-12-17 16:51:11Z kpouer $
  */
 
 // Localization
@@ -106,8 +106,7 @@ void runScript()
 		execScript("Windows Script Host", "wscript " + path);
 	}
 	else {
-		Macros.error(view,
-			String FileNotScriptError);
+		Macros.error(view, FileNotScriptError);
 	}
 }
 
diff --git a/macros/Properties/Insert_Buffer_Properties.bsh b/macros/Properties/Insert_Buffer_Properties.bsh
index 2c19802..d331f96 100644
--- a/macros/Properties/Insert_Buffer_Properties.bsh
+++ b/macros/Properties/Insert_Buffer_Properties.bsh
@@ -1,4 +1,4 @@
-/*
+/* :encoding=UTF-8:
  * Insert_Buffer_Properties.bsh - a Beanshell macro
  * for the jEdit text editor that provides a gui for
  * inserting Buffer Local properties for the current buffer
@@ -24,7 +24,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: Insert_Buffer_Properties.bsh 21353 2012-03-14 09:46:51Z jojaba_67 $
+ * $Id: Insert_Buffer_Properties.bsh 22807 2013-02-20 18:20:47Z kerik-sf $
  */
 
 import java.awt.BorderLayout;
diff --git a/macros/Properties/Look_and_Feel_Properties.bsh b/macros/Properties/Look_and_Feel_Properties.bsh
index bc547fb..aeef1b1 100644
--- a/macros/Properties/Look_and_Feel_Properties.bsh
+++ b/macros/Properties/Look_and_Feel_Properties.bsh
@@ -20,7 +20,7 @@
  * along with the jEdit program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: Look_and_Feel_Properties.bsh 21353 2012-03-14 09:46:51Z jojaba_67 $
+ * $Id: Look_and_Feel_Properties.bsh 22847 2013-03-16 18:40:28Z ezust $
  *
  * Checked for jEdit 4.0 API
  *
@@ -43,6 +43,7 @@ void lookAndFeelProperties()
 	}
 	p.store(sb,ListingLabel);
 	newbuf = jEdit.newFile(view);
+	newbuf.setMode("properties");
 	newbuf.insert(0, sb.toString());
 }
 
diff --git a/macros/Properties/System_Properties.bsh b/macros/Properties/System_Properties.bsh
index 4570e15..0c9fb96 100644
--- a/macros/Properties/System_Properties.bsh
+++ b/macros/Properties/System_Properties.bsh
@@ -20,7 +20,7 @@
  * along with the jEdit program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: System_Properties.bsh 21353 2012-03-14 09:46:51Z jojaba_67 $
+ * $Id: System_Properties.bsh 22847 2013-03-16 18:40:28Z ezust $
  *
  * Checked for jEdit 4.0 API
  *
@@ -36,7 +36,8 @@ systemProperties()
 	sw = new StringWriter();
 	pw = new PrintWriter(sw);
 	props.store(pw,SystemPropertiesLabel);
-	jEdit.newFile(view);
+	newBuf = jEdit.newFile(view);
+	newBuf.setMode("properties");
 	textArea.setSelectedText(sw.toString());
 }
 
diff --git a/macros/Properties/jEdit_Properties.bsh b/macros/Properties/jEdit_Properties.bsh
index bfe4248..3b14e40 100644
--- a/macros/Properties/jEdit_Properties.bsh
+++ b/macros/Properties/jEdit_Properties.bsh
@@ -20,7 +20,7 @@
  * along with the jEdit application; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: jEdit_Properties.bsh 19599 2011-06-19 15:14:10Z kerik-sf $
+ * $Id: jEdit_Properties.bsh 22846 2013-03-16 18:37:31Z ezust $
  *
  * Checked for jEdit 4.0 API
  *
@@ -37,6 +37,7 @@ void writeJEditProperties()
     pw = new PrintWriter(sw);
     props.store(pw,"jedit properties");
     newbuf = jEdit.newFile(view);
+    newbuf.setMode("properties");
     newbuf.insert(0, sw.toString());
 }
 
diff --git a/misc/mode_lint/mode_lint.xsl b/misc/mode_lint/mode_lint.xsl
new file mode 100644
index 0000000..5de1427
--- /dev/null
+++ b/misc/mode_lint/mode_lint.xsl
@@ -0,0 +1,106 @@
+<?xml version="1.0" ?>
+<!-- :mode=xsl:tabSize=2:indentSize=2:folding=none: -->
+<!-- apply to modes/catalog to look for unused rules in mode files
+
+   Copyright © 2012 - Eric Le Lay <kerik-sf at users.sf.net>
+   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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0">
+
+    <!-- output simple one line messages for now -->
+	<xsl:output method="text" encoding="UTF-8"/>
+    
+    <!-- main template: grab rulesets and references in all mode files
+         and compute errors
+      -->
+	<xsl:template match="/">
+    
+    <!-- use the other templates to grab -->
+		<xsl:variable name="refs" as="node()*">
+			<xsl:apply-templates/>
+		</xsl:variable>
+    
+    <!-- analyze the relations -->
+		<xsl:for-each select="$refs/rules">
+    	
+    	<!-- named RULES section not referenced anywhere -->
+			<xsl:if test="not($refs//ref[@name = current()/@set])
+			 and not(ends-with(current()/@set, '::MAIN'))">
+				<xsl:text> mode </xsl:text>
+				<xsl:value-of select="parent::mode/@file"/>
+				<xsl:text> ruleset </xsl:text>
+				<xsl:value-of select="@set"/>
+				<xsl:text> not referenced anywhere 
</xsl:text>
+			</xsl:if>
+	
+			<xsl:for-each select="ref">
+	    	<!-- reference to RULES that can't be found -->
+				<xsl:if test="not($refs//rules[@set = current()/@name])">
+					<xsl:text> mode </xsl:text>
+					<xsl:value-of select="ancestor::mode/@file"/>
+					<xsl:text> undefined ref </xsl:text>
+					<xsl:value-of select="@name"/>
+					<xsl:text>
</xsl:text>
+				</xsl:if>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+	
+	<xsl:template match="MODE[@FILE]">
+		<mode file="{@FILE}" name="{@NAME}">
+			<xsl:apply-templates select="document(@FILE,.)/MODE">
+				<xsl:with-param name="mode-name" tunnel="yes" select="@NAME" as="xs:string"/>
+			</xsl:apply-templates>
+		</mode>
+	</xsl:template>
+	
+	<xsl:template match="RULES[@SET]">
+		<xsl:param name="mode-name" tunnel="yes" as="xs:string"/>
+		<rules set="{$mode-name}::{@SET}">
+			<xsl:apply-templates/>
+		</rules>
+	</xsl:template>
+	
+	<!-- name default RULES mode::MAIN  -->
+	<xsl:template match="RULES">
+		<xsl:param name="mode-name" tunnel="yes" as="xs:string"/>
+		<rules set="{$mode-name}::MAIN">
+			<xsl:apply-templates/>
+		</rules>
+	</xsl:template>
+	
+	<!-- the default template doesn't apply templates to attributes -->
+	<xsl:template match="*">
+		<xsl:apply-templates select="@*"/>
+		<xsl:apply-templates select="*"/>
+	</xsl:template>
+	
+	<!-- in general, ignore attributes and text to avoid noise in the output -->
+	<xsl:template match="@*"/>
+	<xsl:template match="text()"/>
+	
+	<!-- SPAN, IMPORT -->
+	<xsl:template match="@DELEGATE">
+		<xsl:param name="mode-name" tunnel="yes" as="xs:string"/>
+		<xsl:choose>
+			<xsl:when test="contains(.,':')">
+				<ref name="{.}"/>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- always output qualified references -->
+				<ref name="{$mode-name}::{.}"/>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+</xsl:stylesheet>
diff --git a/modes/ant.xml b/modes/ant.xml
index d6eb4ed..53e9ed1 100644
--- a/modes/ant.xml
+++ b/modes/ant.xml
@@ -72,12 +72,12 @@
 			<END>--></END>
 		</SPAN>
 
-		<SPAN TYPE="LITERAL1">
+		<SPAN TYPE="LITERAL1" DELEGATE="STRING">
 			<BEGIN>"</BEGIN>
 			<END>"</END>
 		</SPAN>
 
-		<SPAN TYPE="LITERAL1">
+		<SPAN TYPE="LITERAL1" DELEGATE="STRING">
 			<BEGIN>'</BEGIN>
 			<END>'</END>
 		</SPAN>
@@ -316,8 +316,6 @@
 			<BEGIN>${</BEGIN>
 			<END>}</END>
 		</SPAN>
-		<SEQ TYPE="NULL">\"</SEQ>
-		<SEQ TYPE="MARKUP" DELEGATE="TAGS">"</SEQ>
 
 		<SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
 			<BEGIN>&</BEGIN>
diff --git a/modes/bcel.xml b/modes/bcel.xml
index 328858c..b336f63 100644
--- a/modes/bcel.xml
+++ b/modes/bcel.xml
@@ -19,7 +19,7 @@
         <SEQ TYPE="COMMENT1">/**/</SEQ>
 
         <!-- Javadoc comment -->
-        <SPAN TYPE="COMMENT3" DELEGATE="JAVADOC">
+        <SPAN TYPE="COMMENT3" DELEGATE="java::JAVADOC">
             <BEGIN>/**</BEGIN>
             <END>*/</END>
         </SPAN>
diff --git a/modes/catalog b/modes/catalog
index 5b897a1..1a870b6 100644
--- a/modes/catalog
+++ b/modes/catalog
@@ -93,6 +93,9 @@
 <MODE NAME="c"			FILE="c.xml"
 				FILE_NAME_GLOB="*.c" />
 
+<MODE NAME="cfscript"		FILE="cfscript.xml"
+				FILE_NAME_GLOB="*.cfc" />
+
 <MODE NAME="chill"		FILE="chill.xml"
 				FILE_NAME_GLOB="*.{chl,mpol}" />
 
@@ -256,6 +259,10 @@
 <MODE NAME="io"			FILE="io.xml"
 				FILE_NAME_GLOB="*.io" />
 
+<MODE NAME="jamon"
+      FILE="jamon.xml"
+      FILE_NAME_GLOB="*.jamon" />
+
 <MODE NAME="javacc"		FILE="javacc.xml"
 				FILE_NAME_GLOB="*.{jj,jjt}"/>
 
@@ -385,10 +392,11 @@
 				FILE_NAME_GLOB="*.{pas,dpr,dpk}" />
 
 <MODE NAME="patch"		FILE="patch.xml"
-				FILE_NAME_GLOB="*.{diff,patch}" />
+				FILE_NAME_GLOB="*.{diff,patch}"
+				FIRST_LINE_GLOB="{# HG changeset patch,diff --git *}" />
 
 <MODE NAME="perl"		FILE="perl.xml"
-				FILE_NAME_GLOB="*.p[lm]"
+				FILE_NAME_GLOB="*.p{[lmh],od}"
 				FIRST_LINE_GLOB="#!/*perl*" />
 
 <MODE NAME="php"		FILE="php.xml"
@@ -400,6 +408,9 @@
 
 <MODE NAME="plaintex"		FILE="plaintex.xml" />
 
+<MODE NAME="PostgreSQL" FILE="pg-sql.xml"
+							FILE_NAME_GLOB="*.{pg_sql,pg-sql}" />
+
 <MODE NAME="pl-sql"		FILE="osql.xml"
                            FILE_NAME_GLOB="*.{pls,sql}" />
 
@@ -504,8 +515,11 @@
 <MODE NAME="sas"		FILE="sas.xml"
 				FILE_NAME_GLOB="*.sas" />
 
+<MODE NAME="sbt" FILE="scala.xml"
+        FILE_NAME_GLOB="*.sbt" />
+
 <MODE NAME="scala"  	FILE="scala.xml"
-    			FILE_NAME_GLOB="*.scala" />
+        FILE_NAME_GLOB="*.scala" />
 
 <MODE NAME="scheme"		FILE="scheme.xml"
 				FILE_NAME_GLOB="*.scm" />
diff --git a/modes/cfscript.xml b/modes/cfscript.xml
new file mode 100644
index 0000000..7032a67
--- /dev/null
+++ b/modes/cfscript.xml
@@ -0,0 +1,679 @@
+<?xml version="1.0"?>
+<!DOCTYPE MODE SYSTEM "xmode.dtd">
+<MODE>
+	<PROPS>
+		<PROPERTY NAME="commentStart" VALUE="/*" />
+		<PROPERTY NAME="commentEnd" VALUE="*/" />
+		<PROPERTY NAME="lineComment" VALUE="//" />
+		<PROPERTY NAME="wordBreakChars" VALUE=",+-=<>/?^&*" />
+		
+		<!-- Auto indent -->
+		<PROPERTY NAME="indentOpenBrackets" VALUE="{[" />
+		<PROPERTY NAME="indentCloseBrackets" VALUE="]}" />
+		<PROPERTY NAME="unalignedOpenBrackets" VALUE="(" />
+		<PROPERTY NAME="unalignedCloseBrackets" VALUE=")" />
+		<PROPERTY NAME="indentNextLine"
+			VALUE="\s*(((if|while)\s*\(|else\s*|else\s+if\s*\(|for\s*\(.*\))[^{;]*)" />
+		<PROPERTY NAME="unindentThisLine"
+			VALUE="^.*(default:\s*|case.*:.*)$" />
+		<PROPERTY NAME="electricKeys" VALUE=":" />
+	</PROPS>
+	<RULES IGNORE_CASE="TRUE" HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="(0x[\p{XDigit}]+[lL]?|[\p{Digit}]+(e[\p{Digit}]*)?[lLdDfF]?)">
+		<SPAN TYPE="COMMENT3" DELEGATE="CFDOC">
+			<BEGIN>/**</BEGIN>
+			<END>*/</END>
+		</SPAN>
+		<SPAN TYPE="COMMENT1">
+			<BEGIN>/*</BEGIN>
+			<END>*/</END>
+		</SPAN>
+		<EOL_SPAN TYPE="COMMENT2">//</EOL_SPAN>
+		
+		
+		<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\">
+			<BEGIN>"</BEGIN>
+			<END>"</END>
+		</SPAN>
+
+		<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\">
+			<BEGIN>'</BEGIN>
+			<END>'</END>
+		</SPAN>
+		
+		<MARK_PREVIOUS TYPE="FUNCTION" MATCH_TYPE="OPERATOR">(</MARK_PREVIOUS>
+		<SEQ TYPE="OPERATOR">)</SEQ>
+		
+		<SEQ TYPE="OPERATOR">=</SEQ>
+		<SEQ TYPE="OPERATOR">!</SEQ>
+		<SEQ TYPE="OPERATOR">>=</SEQ>
+		<SEQ TYPE="OPERATOR"><=</SEQ>
+		<SEQ TYPE="OPERATOR">+</SEQ>
+		<SEQ TYPE="OPERATOR">-</SEQ>
+		<SEQ TYPE="OPERATOR">/</SEQ>
+		<SEQ TYPE="OPERATOR">*</SEQ>
+		<SEQ TYPE="OPERATOR">></SEQ>
+		<SEQ TYPE="OPERATOR"><</SEQ>
+		<SEQ TYPE="OPERATOR">%</SEQ>
+		<SEQ TYPE="OPERATOR">&</SEQ>
+		<SEQ TYPE="OPERATOR">|</SEQ>
+		<SEQ TYPE="OPERATOR">^</SEQ>
+		<SEQ TYPE="OPERATOR">~</SEQ>
+		<SEQ TYPE="OPERATOR">.</SEQ>
+		<SEQ TYPE="OPERATOR">}</SEQ>
+		<SEQ TYPE="OPERATOR">{</SEQ>
+		<SEQ TYPE="OPERATOR">,</SEQ>
+		<SEQ TYPE="OPERATOR">;</SEQ>
+		<SEQ TYPE="OPERATOR">]</SEQ>
+		<SEQ TYPE="OPERATOR">[</SEQ>
+		<SEQ TYPE="OPERATOR">?</SEQ>
+		<MARK_PREVIOUS AT_WHITESPACE_END="TRUE"
+			MATCH_TYPE="OPERATOR"
+			TYPE="LABEL">:</MARK_PREVIOUS>
+		<SEQ TYPE="OPERATOR">:</SEQ>
+		
+		<KEYWORDS>
+			<!-- common keywords -->
+			<KEYWORD1>break</KEYWORD1>
+			<KEYWORD1>case</KEYWORD1>
+			<KEYWORD1>catch</KEYWORD1>
+			<KEYWORD1>continue</KEYWORD1>
+			<KEYWORD1>delete</KEYWORD1>
+			<KEYWORD1>do</KEYWORD1>
+			<KEYWORD1>else</KEYWORD1>
+			<KEYWORD1>finally</KEYWORD1>
+			<KEYWORD1>for</KEYWORD1>
+			<KEYWORD1>function</KEYWORD1>
+			<KEYWORD1>if</KEYWORD1>
+			<KEYWORD1>in</KEYWORD1>
+			<KEYWORD1>new</KEYWORD1>
+			<KEYWORD1>return</KEYWORD1>
+			<KEYWORD1>switch</KEYWORD1>
+			<KEYWORD1>throw</KEYWORD1>
+			<KEYWORD1>try</KEYWORD1>
+			<KEYWORD1>typeof</KEYWORD1>
+			<KEYWORD1>var</KEYWORD1>
+			<KEYWORD1>while</KEYWORD1>
+			<KEYWORD1>with</KEYWORD1>
+			
+			<!-- context literals -->
+			<LITERAL2>this</LITERAL2>
+			<LITERAL2>super</LITERAL2>
+			
+			<!-- value literals -->
+			<LITERAL2>false</LITERAL2>
+			<LITERAL2>true</LITERAL2>
+			<LITERAL2>yes</LITERAL2>
+			<LITERAL2>no</LITERAL2>
+			
+			<!-- CF Types -->
+			<KEYWORD3>boolean</KEYWORD3>
+			<KEYWORD3>struct</KEYWORD3>
+			<KEYWORD3>string</KEYWORD3>
+			<KEYWORD3>numeric</KEYWORD3>
+			<KEYWORD3>array</KEYWORD3>
+			<KEYWORD3>any</KEYWORD3>
+			<KEYWORD3>query</KEYWORD3>
+			<KEYWORD3>void</KEYWORD3>
+			
+			<!-- component related -->
+			<KEYWORD3>component</KEYWORD3>
+			<KEYWORD1>implements</KEYWORD1>
+			<KEYWORD1>extends</KEYWORD1>
+			<KEYWORD1>include</KEYWORD1>
+			
+			<!-- access types -->
+			<KEYWORD1>private</KEYWORD1>
+			<KEYWORD1>protected</KEYWORD1>
+			<KEYWORD1>public</KEYWORD1>
+			<KEYWORD1>remote</KEYWORD1>
+			<KEYWORD1>required</KEYWORD1>
+			
+			<KEYWORD1>property</KEYWORD1>
+			
+			<!-- All functions -->
+			<FUNCTION>ACos</FUNCTION>
+			<FUNCTION>ASin</FUNCTION>
+			<FUNCTION>Abort</FUNCTION>
+			<FUNCTION>Abs</FUNCTION>
+			<FUNCTION>AddSOAPRequestHeader</FUNCTION>
+			<FUNCTION>AddSOAPResponseHeader</FUNCTION>
+			<FUNCTION>AjaxLink</FUNCTION>
+			<FUNCTION>AjaxOnLoad</FUNCTION>
+			<FUNCTION>ApplicationStop</FUNCTION>
+			<FUNCTION>ArrayAppend</FUNCTION>
+			<FUNCTION>ArrayAvg</FUNCTION>
+			<FUNCTION>ArrayClear</FUNCTION>
+			<FUNCTION>ArrayContains</FUNCTION>
+			<FUNCTION>ArrayDelete</FUNCTION>
+			<FUNCTION>ArrayDeleteAt</FUNCTION>
+			<FUNCTION>ArrayFind</FUNCTION>
+			<FUNCTION>ArrayFindNoCase</FUNCTION>
+			<FUNCTION>ArrayInsertAt</FUNCTION>
+			<FUNCTION>ArrayIsDefined</FUNCTION>
+			<FUNCTION>ArrayIsEmpty</FUNCTION>
+			<FUNCTION>ArrayLen</FUNCTION>
+			<FUNCTION>ArrayMax</FUNCTION>
+			<FUNCTION>ArrayMin</FUNCTION>
+			<FUNCTION>ArrayNew</FUNCTION>
+			<FUNCTION>ArrayPrepend</FUNCTION>
+			<FUNCTION>ArrayResize</FUNCTION>
+			<FUNCTION>ArraySet</FUNCTION>
+			<FUNCTION>ArraySort</FUNCTION>
+			<FUNCTION>ArraySum</FUNCTION>
+			<FUNCTION>ArraySwap</FUNCTION>
+			<FUNCTION>ArrayToList</FUNCTION>
+			<FUNCTION>Asc</FUNCTION>
+			<FUNCTION>Atn</FUNCTION>
+			<FUNCTION>BinaryDecode</FUNCTION>
+			<FUNCTION>BinaryEncode</FUNCTION>
+			<FUNCTION>BitAnd</FUNCTION>
+			<FUNCTION>BitMaskClear</FUNCTION>
+			<FUNCTION>BitMaskRead</FUNCTION>
+			<FUNCTION>BitMaskSet</FUNCTION>
+			<FUNCTION>BitNot</FUNCTION>
+			<FUNCTION>BitOr</FUNCTION>
+			<FUNCTION>BitSHLN</FUNCTION>
+			<FUNCTION>BitSHRN</FUNCTION>
+			<FUNCTION>BitXor</FUNCTION>
+			<FUNCTION>CJustify</FUNCTION>
+			<FUNCTION>CacheGet</FUNCTION>
+			<FUNCTION>CacheGetAllIds</FUNCTION>
+			<FUNCTION>CacheGetMetadata</FUNCTION>
+			<FUNCTION>CacheGetProperties</FUNCTION>
+			<FUNCTION>CacheGetSession</FUNCTION>
+			<FUNCTION>CachePut</FUNCTION>
+			<FUNCTION>CacheRemove</FUNCTION>
+			<FUNCTION>CacheSetProperties</FUNCTION>
+			<!--FUNCTION>Catch</FUNCTION-->
+			<FUNCTION>Ceiling</FUNCTION>
+			<FUNCTION>CharsetDecode</FUNCTION>
+			<FUNCTION>CharsetEncode</FUNCTION>
+			<FUNCTION>Chr</FUNCTION>
+			<FUNCTION>Compare</FUNCTION>
+			<FUNCTION>CompareNoCase</FUNCTION>
+			<FUNCTION>Cos</FUNCTION>
+			<FUNCTION>CreateDate</FUNCTION>
+			<FUNCTION>CreateDateTime</FUNCTION>
+			<FUNCTION>CreateODBCDate</FUNCTION>
+			<FUNCTION>CreateODBCDateTime</FUNCTION>
+			<FUNCTION>CreateODBCTime</FUNCTION>
+			<FUNCTION>CreateObject</FUNCTION>
+			<FUNCTION>CreateTime</FUNCTION>
+			<FUNCTION>CreateTimeSpan</FUNCTION>
+			<FUNCTION>CreateUUID</FUNCTION>
+			<FUNCTION>DE</FUNCTION>
+			<FUNCTION>DateAdd</FUNCTION>
+			<FUNCTION>DateCompare</FUNCTION>
+			<FUNCTION>DateConvert</FUNCTION>
+			<FUNCTION>DateDiff</FUNCTION>
+			<FUNCTION>DateFormat</FUNCTION>
+			<FUNCTION>DatePart</FUNCTION>
+			<FUNCTION>Day</FUNCTION>
+			<FUNCTION>DayOfWeek</FUNCTION>
+			<FUNCTION>DayOfWeekAsString</FUNCTION>
+			<FUNCTION>DayOfYear</FUNCTION>
+			<FUNCTION>DaysInMonth</FUNCTION>
+			<FUNCTION>DaysInYear</FUNCTION>
+			<FUNCTION>DecimalFormat</FUNCTION>
+			<FUNCTION>DecrementValue</FUNCTION>
+			<FUNCTION>Decrypt</FUNCTION>
+			<FUNCTION>DecryptBinary</FUNCTION>
+			<FUNCTION>DeleteClientVariable</FUNCTION>
+			<FUNCTION>DeserializeJSON</FUNCTION>
+			<FUNCTION>DirectoryCreate</FUNCTION>
+			<FUNCTION>DirectoryDelete</FUNCTION>
+			<FUNCTION>DirectoryExists</FUNCTION>
+			<FUNCTION>DirectoryList</FUNCTION>
+			<FUNCTION>DirectoryRename</FUNCTION>
+			<FUNCTION>DollarFormat</FUNCTION>
+			<FUNCTION>DotNetToCFType</FUNCTION>
+			<FUNCTION>Duplicate</FUNCTION>
+			<FUNCTION>Encrypt</FUNCTION>
+			<FUNCTION>EncryptBinary</FUNCTION>
+			<FUNCTION>EntityDelete</FUNCTION>
+			<FUNCTION>EntityLoad</FUNCTION>
+			<FUNCTION>EntityLoadByExample</FUNCTION>
+			<FUNCTION>EntityLoadByPK</FUNCTION>
+			<FUNCTION>EntityMerge</FUNCTION>
+			<FUNCTION>EntityNew</FUNCTION>
+			<FUNCTION>EntityReload</FUNCTION>
+			<FUNCTION>EntitySave</FUNCTION>
+			<FUNCTION>EntitytoQuery</FUNCTION>
+			<FUNCTION>Evaluate</FUNCTION>
+			<FUNCTION>Exp</FUNCTION>
+			<FUNCTION>ExpandPath</FUNCTION>
+			<FUNCTION>FileClose</FUNCTION>
+			<FUNCTION>FileCopy</FUNCTION>
+			<FUNCTION>FileDelete</FUNCTION>
+			<FUNCTION>FileExists</FUNCTION>
+			<FUNCTION>FileIsEOF</FUNCTION>
+			<FUNCTION>FileMove</FUNCTION>
+			<FUNCTION>FileOpen</FUNCTION>
+			<FUNCTION>FileRead</FUNCTION>
+			<FUNCTION>FileReadBinary</FUNCTION>
+			<FUNCTION>FileReadLine</FUNCTION>
+			<FUNCTION>FileSeek</FUNCTION>
+			<FUNCTION>FileSetAccessMode</FUNCTION>
+			<FUNCTION>FileSetAttribute</FUNCTION>
+			<FUNCTION>FileSetLastModified</FUNCTION>
+			<FUNCTION>FileSkipBytes</FUNCTION>
+			<FUNCTION>FileUpload</FUNCTION>
+			<FUNCTION>FileUploadAll</FUNCTION>
+			<FUNCTION>FileWrite</FUNCTION>
+			<FUNCTION>Find</FUNCTION>
+			<FUNCTION>FindNoCase</FUNCTION>
+			<FUNCTION>FindOneOf</FUNCTION>
+			<FUNCTION>FirstDayOfMonth</FUNCTION>
+			<FUNCTION>Fix</FUNCTION>
+			<FUNCTION>FormatBaseN</FUNCTION>
+			<FUNCTION>GenerateSecretKey</FUNCTION>
+			<FUNCTION>GetAuthUser</FUNCTION>
+			<FUNCTION>GetBaseTagData</FUNCTION>
+			<FUNCTION>GetBaseTagList</FUNCTION>
+			<FUNCTION>GetBaseTemplatePath</FUNCTION>
+			<FUNCTION>GetClientVariablesList</FUNCTION>
+			<FUNCTION>GetComponentMetaData</FUNCTION>
+			<FUNCTION>GetContextRoot</FUNCTION>
+			<FUNCTION>GetCurrentTemplatePath</FUNCTION>
+			<FUNCTION>GetDirectoryFromPath</FUNCTION>
+			<FUNCTION>GetEncoding</FUNCTION>
+			<FUNCTION>GetException</FUNCTION>
+			<FUNCTION>GetFileFromPath</FUNCTION>
+			<FUNCTION>GetFileInfo</FUNCTION>
+			<FUNCTION>GetFunctionCalledName</FUNCTION>
+			<FUNCTION>GetFunctionList</FUNCTION>
+			<FUNCTION>GetGatewayHelper</FUNCTION>
+			<FUNCTION>GetHttpRequestData</FUNCTION>
+			<FUNCTION>GetHttpTimeString</FUNCTION>
+			<FUNCTION>GetLocalHostIP</FUNCTION>
+			<FUNCTION>GetLocale</FUNCTION>
+			<FUNCTION>GetLocaleDisplayName</FUNCTION>
+			<FUNCTION>GetMetaData</FUNCTION>
+			<FUNCTION>GetMetricData</FUNCTION>
+			<FUNCTION>GetPageContext</FUNCTION>
+			<FUNCTION>GetPrinterInfo</FUNCTION>
+			<FUNCTION>GetProfileSections</FUNCTION>
+			<FUNCTION>GetProfileString</FUNCTION>
+			<FUNCTION>GetReadableImageFormats</FUNCTION>
+			<FUNCTION>GetSOAPRequest</FUNCTION>
+			<FUNCTION>GetSOAPRequestHeader</FUNCTION>
+			<FUNCTION>GetSOAPResponse</FUNCTION>
+			<FUNCTION>GetSOAPResponseHeader</FUNCTION>
+			<FUNCTION>GetTempDirectory</FUNCTION>
+			<FUNCTION>GetTempFile</FUNCTION>
+			<FUNCTION>GetTemplatePath</FUNCTION>
+			<FUNCTION>GetTickCount</FUNCTION>
+			<FUNCTION>GetTimeZoneInfo</FUNCTION>
+			<FUNCTION>GetToken</FUNCTION>
+			<FUNCTION>GetUserRoles</FUNCTION>
+			<FUNCTION>GetWriteableImageFormats</FUNCTION>
+			<FUNCTION>HTMLCodeFormat</FUNCTION>
+			<FUNCTION>HTMLEditFormat</FUNCTION>
+			<FUNCTION>Hash</FUNCTION>
+			<FUNCTION>Hour</FUNCTION>
+			<FUNCTION>IIf</FUNCTION>
+			<FUNCTION>ImageAddBorder</FUNCTION>
+			<FUNCTION>ImageBlur</FUNCTION>
+			<FUNCTION>ImageClearRect</FUNCTION>
+			<FUNCTION>ImageCopy</FUNCTION>
+			<FUNCTION>ImageCrop</FUNCTION>
+			<FUNCTION>ImageDrawArc</FUNCTION>
+			<FUNCTION>ImageDrawBeveledRect</FUNCTION>
+			<FUNCTION>ImageDrawCubicCurve</FUNCTION>
+			<FUNCTION>ImageDrawLine</FUNCTION>
+			<FUNCTION>ImageDrawLines</FUNCTION>
+			<FUNCTION>ImageDrawOval</FUNCTION>
+			<FUNCTION>ImageDrawPoint</FUNCTION>
+			<FUNCTION>ImageDrawQuadraticCurve</FUNCTION>
+			<FUNCTION>ImageDrawRect</FUNCTION>
+			<FUNCTION>ImageDrawRoundRect</FUNCTION>
+			<FUNCTION>ImageDrawText</FUNCTION>
+			<FUNCTION>ImageFlip</FUNCTION>
+			<FUNCTION>ImageGetBlob</FUNCTION>
+			<FUNCTION>ImageGetBufferedImage</FUNCTION>
+			<FUNCTION>ImageGetEXIFTag</FUNCTION>
+			<FUNCTION>ImageGetHeight</FUNCTION>
+			<FUNCTION>ImageGetIPTCTag</FUNCTION>
+			<FUNCTION>ImageGetWidth</FUNCTION>
+			<FUNCTION>ImageGrayscale</FUNCTION>
+			<FUNCTION>ImageInfo</FUNCTION>
+			<FUNCTION>ImageNegative</FUNCTION>
+			<FUNCTION>ImageNew</FUNCTION>
+			<FUNCTION>ImageOverlay</FUNCTION>
+			<FUNCTION>ImagePaste</FUNCTION>
+			<FUNCTION>ImageRead</FUNCTION>
+			<FUNCTION>ImageReadBase64</FUNCTION>
+			<FUNCTION>ImageResize</FUNCTION>
+			<FUNCTION>ImageRotate</FUNCTION>
+			<FUNCTION>ImageRotateDrawingAxis</FUNCTION>
+			<FUNCTION>ImageScaleToFit</FUNCTION>
+			<FUNCTION>ImageSetAntialiasing</FUNCTION>
+			<FUNCTION>ImageSetBackgroundColor</FUNCTION>
+			<FUNCTION>ImageSetDrawingColor</FUNCTION>
+			<FUNCTION>ImageSetDrawingStroke</FUNCTION>
+			<FUNCTION>ImageSetDrawingTransparency</FUNCTION>
+			<FUNCTION>ImageSharpen</FUNCTION>
+			<FUNCTION>ImageShear</FUNCTION>
+			<FUNCTION>ImageShearDrawingAxis</FUNCTION>
+			<FUNCTION>ImageTranslate</FUNCTION>
+			<FUNCTION>ImageTranslateDrawingAxis</FUNCTION>
+			<FUNCTION>ImageWrite</FUNCTION>
+			<FUNCTION>ImageWriteBase64</FUNCTION>
+			<FUNCTION>ImageXORDrawingMode</FUNCTION>
+			<FUNCTION>IncrementValue</FUNCTION>
+			<FUNCTION>InputBaseN</FUNCTION>
+			<FUNCTION>Insert</FUNCTION>
+			<FUNCTION>Int</FUNCTION>
+			<FUNCTION>IsArray</FUNCTION>
+			<FUNCTION>IsBinary</FUNCTION>
+			<FUNCTION>IsBoolean</FUNCTION>
+			<FUNCTION>IsCustomFunction</FUNCTION>
+			<FUNCTION>IsDDX</FUNCTION>
+			<FUNCTION>IsDate</FUNCTION>
+			<FUNCTION>IsDebugMode</FUNCTION>
+			<FUNCTION>IsDefined</FUNCTION>
+			<FUNCTION>IsImage</FUNCTION>
+			<FUNCTION>IsImageFile</FUNCTION>
+			<FUNCTION>IsInstanceOf</FUNCTION>
+			<FUNCTION>IsJSON</FUNCTION>
+			<FUNCTION>IsK2ServerABroker</FUNCTION>
+			<FUNCTION>IsK2ServerDocCountExceeded</FUNCTION>
+			<FUNCTION>IsK2ServerOnline</FUNCTION>
+			<FUNCTION>IsLeapYear</FUNCTION>
+			<FUNCTION>IsLocalHost</FUNCTION>
+			<FUNCTION>IsNull</FUNCTION>
+			<FUNCTION>IsNumeric</FUNCTION>
+			<FUNCTION>IsNumericDate</FUNCTION>
+			<FUNCTION>IsObject</FUNCTION>
+			<FUNCTION>IsPDFFile</FUNCTION>
+			<FUNCTION>IsPDFObject</FUNCTION>
+			<FUNCTION>IsQuery</FUNCTION>
+			<FUNCTION>IsSOAPRequest</FUNCTION>
+			<FUNCTION>IsSimpleValue</FUNCTION>
+			<FUNCTION>IsStruct</FUNCTION>
+			<FUNCTION>IsUserInAnyRole</FUNCTION>
+			<FUNCTION>IsUserInRole</FUNCTION>
+			<FUNCTION>IsUserLoggedIn</FUNCTION>
+			<FUNCTION>IsValid</FUNCTION>
+			<FUNCTION>IsWDDX</FUNCTION>
+			<FUNCTION>IsXML</FUNCTION>
+			<FUNCTION>IsXmlAttribute</FUNCTION>
+			<FUNCTION>IsXmlDoc</FUNCTION>
+			<FUNCTION>IsXmlElem</FUNCTION>
+			<FUNCTION>IsXmlNode</FUNCTION>
+			<FUNCTION>IsXmlRoot</FUNCTION>
+			<FUNCTION>JSStringFormat</FUNCTION>
+			<FUNCTION>JavaCast</FUNCTION>
+			<FUNCTION>LCase</FUNCTION>
+			<FUNCTION>LJustify</FUNCTION>
+			<FUNCTION>LSCurrencyFormat</FUNCTION>
+			<FUNCTION>LSDateFormat</FUNCTION>
+			<FUNCTION>LSEuroCurrencyFormat</FUNCTION>
+			<FUNCTION>LSIsCurrency</FUNCTION>
+			<FUNCTION>LSIsDate</FUNCTION>
+			<FUNCTION>LSIsNumeric</FUNCTION>
+			<FUNCTION>LSNumberFormat</FUNCTION>
+			<FUNCTION>LSParseCurrency</FUNCTION>
+			<FUNCTION>LSParseDateTime</FUNCTION>
+			<FUNCTION>LSParseEuroCurrency</FUNCTION>
+			<FUNCTION>LSParseNumber</FUNCTION>
+			<FUNCTION>LSTimeFormat</FUNCTION>
+			<FUNCTION>LTrim</FUNCTION>
+			<FUNCTION>Left</FUNCTION>
+			<FUNCTION>Len</FUNCTION>
+			<FUNCTION>ListAppend</FUNCTION>
+			<FUNCTION>ListChangeDelims</FUNCTION>
+			<FUNCTION>ListContains</FUNCTION>
+			<FUNCTION>ListContainsNoCase</FUNCTION>
+			<FUNCTION>ListDeleteAt</FUNCTION>
+			<FUNCTION>ListFind</FUNCTION>
+			<FUNCTION>ListFindNoCase</FUNCTION>
+			<FUNCTION>ListFirst</FUNCTION>
+			<FUNCTION>ListGetAt</FUNCTION>
+			<FUNCTION>ListInsertAt</FUNCTION>
+			<FUNCTION>ListLast</FUNCTION>
+			<FUNCTION>ListLen</FUNCTION>
+			<FUNCTION>ListPrepend</FUNCTION>
+			<FUNCTION>ListQualify</FUNCTION>
+			<FUNCTION>ListRest</FUNCTION>
+			<FUNCTION>ListSetAt</FUNCTION>
+			<FUNCTION>ListSort</FUNCTION>
+			<FUNCTION>ListToArray</FUNCTION>
+			<FUNCTION>ListValueCount</FUNCTION>
+			<FUNCTION>ListValueCountNoCase</FUNCTION>
+			<FUNCTION>Location</FUNCTION>
+			<FUNCTION>Log</FUNCTION>
+			<FUNCTION>Log10</FUNCTION>
+			<FUNCTION>Max</FUNCTION>
+			<FUNCTION>Mid</FUNCTION>
+			<FUNCTION>Min</FUNCTION>
+			<FUNCTION>Minute</FUNCTION>
+			<FUNCTION>Month</FUNCTION>
+			<FUNCTION>MonthAsString</FUNCTION>
+			<FUNCTION>Now</FUNCTION>
+			<FUNCTION>NumberFormat</FUNCTION>
+			<FUNCTION>ORMClearSession</FUNCTION>
+			<FUNCTION>ORMCloseSession</FUNCTION>
+			<FUNCTION>ORMEvictCollection</FUNCTION>
+			<FUNCTION>ORMEvictEntity</FUNCTION>
+			<FUNCTION>ORMEvictQueries</FUNCTION>
+			<FUNCTION>ORMExecuteQuery</FUNCTION>
+			<FUNCTION>ORMFlush</FUNCTION>
+			<FUNCTION>ORMGetSession</FUNCTION>
+			<FUNCTION>ORMGetSessionFactory</FUNCTION>
+			<FUNCTION>ORMReload</FUNCTION>
+			<FUNCTION>ObjectEquals</FUNCTION>
+			<FUNCTION>ObjectLoad</FUNCTION>
+			<FUNCTION>ObjectSave</FUNCTION>
+			<FUNCTION>ParagraphFormat</FUNCTION>
+			<FUNCTION>ParseDateTime</FUNCTION>
+			<FUNCTION>Pi</FUNCTION>
+			<FUNCTION>PrecisionEvaluate</FUNCTION>
+			<FUNCTION>PreserveSingleQuotes</FUNCTION>
+			<FUNCTION>Quarter</FUNCTION>
+			<FUNCTION>QueryAddColumn</FUNCTION>
+			<FUNCTION>QueryAddRow</FUNCTION>
+			<FUNCTION>QueryConvertForGrid</FUNCTION>
+			<FUNCTION>QueryNew</FUNCTION>
+			<FUNCTION>QuerySetCell</FUNCTION>
+			<FUNCTION>QuotedValueList</FUNCTION>
+			<FUNCTION>REFind</FUNCTION>
+			<FUNCTION>REFindNoCase</FUNCTION>
+			<FUNCTION>REMatch</FUNCTION>
+			<FUNCTION>REMatchNoCase</FUNCTION>
+			<FUNCTION>REReplace</FUNCTION>
+			<FUNCTION>REReplaceNoCase</FUNCTION>
+			<FUNCTION>RJustify</FUNCTION>
+			<FUNCTION>RTrim</FUNCTION>
+			<FUNCTION>Rand</FUNCTION>
+			<FUNCTION>RandRange</FUNCTION>
+			<FUNCTION>Randomize</FUNCTION>
+			<FUNCTION>ReleaseComObject</FUNCTION>
+			<FUNCTION>RemoveChars</FUNCTION>
+			<FUNCTION>RepeatString</FUNCTION>
+			<FUNCTION>Replace</FUNCTION>
+			<FUNCTION>ReplaceList</FUNCTION>
+			<FUNCTION>ReplaceNoCase</FUNCTION>
+			<FUNCTION>Reverse</FUNCTION>
+			<FUNCTION>Right</FUNCTION>
+			<FUNCTION>Round</FUNCTION>
+			<FUNCTION>Second</FUNCTION>
+			<FUNCTION>SendGatewayMessage</FUNCTION>
+			<FUNCTION>SerializeJSON</FUNCTION>
+			<FUNCTION>SetLocale</FUNCTION>
+			<FUNCTION>SetProfileString</FUNCTION>
+			<FUNCTION>SetVariable</FUNCTION>
+			<FUNCTION>Sgn</FUNCTION>
+			<FUNCTION>Sin</FUNCTION>
+			<FUNCTION>Sleep</FUNCTION>
+			<FUNCTION>SpanExcluding</FUNCTION>
+			<FUNCTION>SpanIncluding</FUNCTION>
+			<FUNCTION>SpreadsheetAddColumn</FUNCTION>
+			<FUNCTION>SpreadsheetAddFreezePane</FUNCTION>
+			<FUNCTION>SpreadsheetAddImage</FUNCTION>
+			<FUNCTION>SpreadsheetAddInfo</FUNCTION>
+			<FUNCTION>SpreadsheetAddRow</FUNCTION>
+			<FUNCTION>SpreadsheetAddRows</FUNCTION>
+			<FUNCTION>SpreadsheetAddSplitPane</FUNCTION>
+			<FUNCTION>SpreadsheetCreateSheet</FUNCTION>
+			<FUNCTION>SpreadsheetDeleteColumn</FUNCTION>
+			<FUNCTION>SpreadsheetDeleteColumns</FUNCTION>
+			<FUNCTION>SpreadsheetDeleteRow</FUNCTION>
+			<FUNCTION>SpreadsheetDeleteRows</FUNCTION>
+			<FUNCTION>SpreadsheetFormatCell</FUNCTION>
+			<FUNCTION>SpreadsheetFormatCellRange</FUNCTION>
+			<FUNCTION>SpreadsheetFormatColumn</FUNCTION>
+			<FUNCTION>SpreadsheetFormatColumns</FUNCTION>
+			<FUNCTION>SpreadsheetFormatRow</FUNCTION>
+			<FUNCTION>SpreadsheetFormatRows</FUNCTION>
+			<FUNCTION>SpreadsheetGetCellComment</FUNCTION>
+			<FUNCTION>SpreadsheetGetCellFormula</FUNCTION>
+			<FUNCTION>SpreadsheetGetCellValue</FUNCTION>
+			<FUNCTION>SpreadsheetInfo</FUNCTION>
+			<FUNCTION>SpreadsheetMergeCells</FUNCTION>
+			<FUNCTION>SpreadsheetNew</FUNCTION>
+			<FUNCTION>SpreadsheetRead</FUNCTION>
+			<FUNCTION>SpreadsheetReadBinary</FUNCTION>
+			<FUNCTION>SpreadsheetRemoveSheet</FUNCTION>
+			<FUNCTION>SpreadsheetSetActiveSheet</FUNCTION>
+			<FUNCTION>SpreadsheetSetActiveSheetNumber</FUNCTION>
+			<FUNCTION>SpreadsheetSetCellComment</FUNCTION>
+			<FUNCTION>SpreadsheetSetCellFormula</FUNCTION>
+			<FUNCTION>SpreadsheetSetCellValue</FUNCTION>
+			<FUNCTION>SpreadsheetSetColumnWidth</FUNCTION>
+			<FUNCTION>SpreadsheetSetFooter</FUNCTION>
+			<FUNCTION>SpreadsheetSetHeader</FUNCTION>
+			<FUNCTION>SpreadsheetSetRowHeight</FUNCTION>
+			<FUNCTION>SpreadsheetShiftColumns</FUNCTION>
+			<FUNCTION>SpreadsheetShiftRows</FUNCTION>
+			<FUNCTION>SpreadsheetWrite</FUNCTION>
+			<FUNCTION>Sqr</FUNCTION>
+			<FUNCTION>StripCR</FUNCTION>
+			<FUNCTION>StructAppend</FUNCTION>
+			<FUNCTION>StructClear</FUNCTION>
+			<FUNCTION>StructCopy</FUNCTION>
+			<FUNCTION>StructCount</FUNCTION>
+			<FUNCTION>StructDelete</FUNCTION>
+			<FUNCTION>StructFind</FUNCTION>
+			<FUNCTION>StructFindKey</FUNCTION>
+			<FUNCTION>StructFindValue</FUNCTION>
+			<FUNCTION>StructGet</FUNCTION>
+			<FUNCTION>StructInsert</FUNCTION>
+			<FUNCTION>StructIsEmpty</FUNCTION>
+			<FUNCTION>StructKeyArray</FUNCTION>
+			<FUNCTION>StructKeyExists</FUNCTION>
+			<FUNCTION>StructKeyList</FUNCTION>
+			<FUNCTION>StructNew</FUNCTION>
+			<FUNCTION>StructSort</FUNCTION>
+			<FUNCTION>StructUpdate</FUNCTION>
+			<FUNCTION>Tan</FUNCTION>
+			<!---FUNCTION>Throw</FUNCTION-->
+			<FUNCTION>TimeFormat</FUNCTION>
+			<FUNCTION>ToBase64</FUNCTION>
+			<FUNCTION>ToBinary</FUNCTION>
+			<FUNCTION>ToScript</FUNCTION>
+			<FUNCTION>ToString</FUNCTION>
+			<FUNCTION>Trace</FUNCTION>
+			<!--FUNCTION>Try</FUNCTION-->
+			<FUNCTION>TransactionCommit</FUNCTION>
+			<FUNCTION>TransactionRollback</FUNCTION>
+			<FUNCTION>TransactionSetSavePoint</FUNCTION>
+			<FUNCTION>Trim</FUNCTION>
+			<FUNCTION>UCase</FUNCTION>
+			<FUNCTION>URLDecode</FUNCTION>
+			<FUNCTION>URLEncodedFormat</FUNCTION>
+			<FUNCTION>URLSessionFormat</FUNCTION>
+			<FUNCTION>Val</FUNCTION>
+			<FUNCTION>ValueList</FUNCTION>
+			<FUNCTION>VerifyClient</FUNCTION>
+			<FUNCTION>Week</FUNCTION>
+			<FUNCTION>Wrap</FUNCTION>
+			<FUNCTION>WriteDump</FUNCTION>
+			<FUNCTION>WriteLog</FUNCTION>
+			<FUNCTION>WriteOutput</FUNCTION>
+			<FUNCTION>XmlChildPos</FUNCTION>
+			<FUNCTION>XmlElemNew</FUNCTION>
+			<FUNCTION>XmlFormat</FUNCTION>
+			<FUNCTION>XmlGetNodeType</FUNCTION>
+			<FUNCTION>XmlNew</FUNCTION>
+			<FUNCTION>XmlParse</FUNCTION>
+			<FUNCTION>XmlSearch</FUNCTION>
+			<FUNCTION>XmlTransform</FUNCTION>
+			<FUNCTION>XmlValidate</FUNCTION>
+			<FUNCTION>Year</FUNCTION>
+			<FUNCTION>YesNoFormat</FUNCTION>
+			
+			<!-- Scopes -->
+			<KEYWORD2>Variables</KEYWORD2>
+			<KEYWORD2>Arguments</KEYWORD2>
+			<KEYWORD2>Request</KEYWORD2>
+			<KEYWORD2>Session</KEYWORD2>
+			<KEYWORD2>Local</KEYWORD2>
+			<KEYWORD2>Form</KEYWORD2>
+			<KEYWORD2>CGI</KEYWORD2>
+			<KEYWORD2>URL</KEYWORD2>
+			<KEYWORD2>Attributes</KEYWORD2>
+			<KEYWORD2>Application</KEYWORD2>
+			<KEYWORD2>Cookie</KEYWORD2>
+			
+			
+			<!-- ColdFusion Operators -->
+			<OPERATOR>IS</OPERATOR>
+			<OPERATOR>EQ</OPERATOR>
+			<OPERATOR>NEQ</OPERATOR>
+			<OPERATOR>GT</OPERATOR>
+			<OPERATOR>GTE</OPERATOR>
+			<OPERATOR>LT</OPERATOR>
+			<OPERATOR>LTE</OPERATOR>
+	
+			<OPERATOR>LESS</OPERATOR>
+			<OPERATOR>GREATER</OPERATOR>
+			<OPERATOR>THAN</OPERATOR>
+			
+			<OPERATOR>AND</OPERATOR>
+			<OPERATOR>OR</OPERATOR>
+			<OPERATOR>NOT</OPERATOR>
+			<OPERATOR>XOR</OPERATOR>
+		</KEYWORDS>
+	</RULES>
+	
+	<RULES SET="CFDOC" DEFAULT="COMMENT3" IGNORE_CASE="TRUE">
+		<MARK_FOLLOWING TYPE="LITERAL3">@</MARK_FOLLOWING>
+		
+		<KEYWORDS>
+			<LITERAL1>@hint</LITERAL1>
+			<LITERAL1>@displayname</LITERAL1>
+			<LITERAL1>@output</LITERAL1>
+			<LITERAL1>@access</LITERAL1>
+			<LITERAL1>@accessors</LITERAL1>
+			<LITERAL1>@returntype</LITERAL1>
+			<LITERAL1>@roles</LITERAL1>
+			<LITERAL1>@default</LITERAL1>
+			<LITERAL1>@required</LITERAL1>
+			<LITERAL1>@extends</LITERAL1>
+			<LITERAL1>@implements</LITERAL1>
+			
+			<!-- entity related -->
+			<LITERAL2>@update</LITERAL2>
+			<LITERAL2>@insert</LITERAL2>
+			<LITERAL2>@formula</LITERAL2>
+			<LITERAL2>@dbdefault</LITERAL2>
+			<LITERAL2>@persistent</LITERAL2>
+			<LITERAL2>@optimisticlock</LITERAL2>
+			<LITERAL2>@unique</LITERAL2>
+			<LITERAL2>@uniquekey</LITERAL2>
+			<LITERAL2>@sqltype</LITERAL2>
+			<LITERAL2>@generator</LITERAL2>
+			<LITERAL2>@generated</LITERAL2>
+			<LITERAL2>@notnull</LITERAL2>
+			<LITERAL2>@length</LITERAL2>
+			<LITERAL2>@scale</LITERAL2>
+			<LITERAL2>@precision</LITERAL2>
+			<LITERAL2>@fieldtype</LITERAL2>
+			<LITERAL2>@ormtype</LITERAL2>
+			<LITERAL2>@column</LITERAL2>
+		</KEYWORDS>
+		
+		
+	</RULES>
+</MODE>
diff --git a/modes/clips.xml b/modes/clips.xml
index a6f1a54..0a2591d 100644
--- a/modes/clips.xml
+++ b/modes/clips.xml
@@ -33,7 +33,7 @@
 		</SPAN>
 
 		<!-- List literals -->
-		<SPAN TYPE="LITERAL2" NO_LINE_BREAK="TRUE" DELEGATE="LIST">
+		<SPAN TYPE="LITERAL2" NO_LINE_BREAK="TRUE">
 			<BEGIN>[</BEGIN>
 			<END>]</END>
 		</SPAN>
diff --git a/modes/coffeescript.xml b/modes/coffeescript.xml
index a5b5bda..275f6a4 100644
--- a/modes/coffeescript.xml
+++ b/modes/coffeescript.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE MODE SYSTEM "xmode.dtd">
 
-<!-- CoffeeScript mode by Dennis Hotson, Balazs Toth
+<!-- CoffeeScript mode by Dennis Hotson, Balazs Toth, Marc Häfner
 
 Beta
 
@@ -17,7 +17,7 @@ TODO:
 
 		<!-- Auto indent -->
 		<PROPERTY NAME="indentNextLines"
-			VALUE="((\s*|.*\s+)([\-=]>|[\+\-\*/%\\<>=\!&\|\^~]|(.*:|<<|>>|>>>|\+=|\-=|\*=|/=|%=|<=|>=|==|===|\!=|\!==|is|isnt|not|and|or|&&|\|\||of|in))|\s*(if|else|try|catch|finally|class|while|until|for)(\s*|\s+.*))\s*" />
+			VALUE="((\s*|.*\s+)([\-=]>|[\+\-\*/%\\<>=\!&\|\^~]|(.*:|<<|>>|>>>|\+=|\-=|\*=|/=|%=|<=|>=|==|===|\!=|\!==|is|isnt|not|and|or|&&|\|\||of|in|loop))|\s*(if|else|try|catch|finally|class|while|until|for)(\s*|\s+.*))\s*" />
 
 		<PROPERTY NAME="unindentThisLine"  VALUE="^\s*(else|catch|finally)(\s*|\s+.*)$" />
 		<PROPERTY NAME="unindentNextLines" VALUE="^\s*(else|catch|finally)(\s*|\s+.*)$" />
@@ -35,12 +35,13 @@ TODO:
 	<RULES
 		IGNORE_CASE="FALSE"
 		HIGHLIGHT_DIGITS="TRUE"
-		DIGIT_RE="(0[xX][0-9a-fA-F]+)|([0-9]+(\.[0-9]+)?([eE][+\-]?[0-9]+)?)">
+		NO_WORD_SEP="$_"
+		DIGIT_RE="(0b[01]+)|(0o[0-7]+)|(0x\p{XDigit}+)|(\d*\.?\d+(e[+-]?\d+)?)">
 
-		<SPAN TYPE="COMMENT2">
-			<BEGIN>###</BEGIN>
-			<END>###</END>
-		</SPAN>
+		<SPAN_REGEXP TYPE="COMMENT2" HASH_CHARS="###">
+			<BEGIN>###(?!#)</BEGIN>
+			<END REGEXP="TRUE">#{3,}</END>
+		</SPAN_REGEXP>
 		<EOL_SPAN TYPE="COMMENT1">#</EOL_SPAN>
 
 		<SPAN TYPE="LITERAL1" NO_LINE_BREAK="FALSE" ESCAPE="\" DELEGATE="doubleQuoteLiteral">
@@ -68,13 +69,16 @@ TODO:
 			<END>`</END>
 		</SPAN>
 
-		<!-- Javascript-style regexps -->
-		<SEQ_REGEXP TYPE="MARKUP">(?<!\d)\s*/(?![\s/*+{}?]).*/[igmy]*</SEQ_REGEXP>
 		<!-- Heregexps -->
-		<SPAN TYPE="MARKUP" DELEGATE="hereRegexp">
+		<SPAN TYPE="MARKUP" DELEGATE="hereRegexp" ESCAPE="\">
 			<BEGIN>///</BEGIN>
 			<END>///</END>
 		</SPAN>
+		<!-- Javascript-style regexps -->
+		<SPAN_REGEXP TYPE="MARKUP" HASH_CHAR="/" AT_WORD_START="TRUE" NO_LINE_BREAK="TRUE" ESCAPE="\">
+		    <BEGIN>/(?![\s=*])</BEGIN>
+		    <END REGEXP="TRUE">/[igmy]{0,4}</END>
+		</SPAN_REGEXP>
 
 		<MARK_PREVIOUS TYPE="FUNCTION" MATCH_TYPE="OPERATOR">(</MARK_PREVIOUS>
 		<!-- Seems to be equivalent to
@@ -105,8 +109,9 @@ TODO:
 		<SEQ TYPE="OPERATOR">~</SEQ>
 		<SEQ TYPE="OPERATOR">?</SEQ>
 
-		<SEQ_REGEXP TYPE="KEYWORD3">@([a-zA-Z\$_](\w|\$)*)</SEQ_REGEXP>
-		<SEQ_REGEXP TYPE="KEYWORD4">([a-zA-Z\$_](\w|\$)*)(?=\s*[:\.])</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="KEYWORD3">@([\p{L}\p{Nl}\$_][\p{L}\p{Nl}\p{Nd}\$_]*)</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="KEYWORD4">([\p{L}\p{Nl}\$_][\p{L}\p{Nl}\p{Nd}\$_]*)(?=\s*(?:[:\.]|\?\.))</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="KEYWORD1" AT_WORD_START="TRUE" HASH_CHARS="for ">for\s+own(?![\p{L}\p{Nl}\p{Nd}\$_])</SEQ_REGEXP>
 
 		<KEYWORDS>
 			<KEYWORD3>this</KEYWORD3>
@@ -125,6 +130,7 @@ TODO:
 			<KEYWORD1>for</KEYWORD1>
 			<KEYWORD1>in</KEYWORD1>
 			<KEYWORD1>while</KEYWORD1>
+			<KEYWORD1>loop</KEYWORD1>
 			<KEYWORD1>delete</KEYWORD1>
 			<KEYWORD1>instanceof</KEYWORD1>
 			<KEYWORD1>typeof</KEYWORD1>
@@ -132,25 +138,12 @@ TODO:
 			<KEYWORD1>extends</KEYWORD1>
 			<KEYWORD1>class</KEYWORD1>
 			<KEYWORD1>constructor</KEYWORD1>
-			<KEYWORD1>case</KEYWORD1>
-			<KEYWORD1>default</KEYWORD1>
 			<KEYWORD1>do</KEYWORD1>
-			<KEYWORD1>function</KEYWORD1>
-			<KEYWORD1>var</KEYWORD1>
-			<KEYWORD1>void</KEYWORD1>
-			<KEYWORD1>with</KEYWORD1>
-			<KEYWORD1>const</KEYWORD1>
-			<KEYWORD1>let</KEYWORD1>
-			<KEYWORD1>enum</KEYWORD1>
-			<KEYWORD1>export</KEYWORD1>
-			<KEYWORD1>import</KEYWORD1>
-			<KEYWORD1>native</KEYWORD1>
 			<KEYWORD1>then</KEYWORD1>
 			<KEYWORD1>unless</KEYWORD1>
 			<KEYWORD1>until</KEYWORD1>
 			<KEYWORD1>of</KEYWORD1>
 			<KEYWORD1>by</KEYWORD1>
-			<KEYWORD1>where</KEYWORD1>
 			<KEYWORD1>when</KEYWORD1>
 
 			<KEYWORD1>and</KEYWORD1>
@@ -172,6 +165,7 @@ TODO:
 			<KEYWORD3>String</KEYWORD3>
 
 			<!-- Literals -->
+			<LITERAL2>undefined</LITERAL2>
 			<LITERAL2>false</LITERAL2>
 			<LITERAL2>null</LITERAL2>
 			<LITERAL2>true</LITERAL2>
@@ -202,8 +196,12 @@ TODO:
 		</SPAN>
 	</RULES>
 
-	<!-- Comments in heregexes -->
+	<!-- Comments and #{} interpolation in heregexes -->
 	<RULES DEFAULT="MARKUP" SET="hereRegexp" ESCAPE="\">
+		<SPAN DELEGATE="MAIN" TYPE="OPERATOR">
+			<BEGIN>#{</BEGIN>
+			<END>}</END>
+		</SPAN>
 		<EOL_SPAN TYPE="COMMENT1">#</EOL_SPAN>
 	</RULES>
 
diff --git a/modes/coldfusion.xml b/modes/coldfusion.xml
index c9e6e69..1ff81d7 100644
--- a/modes/coldfusion.xml
+++ b/modes/coldfusion.xml
@@ -29,13 +29,19 @@
 			<BEGIN><!--</BEGIN>
 			<END>--></END>
 		</SPAN>
-
+		
 		<!-- CFScript -->
-		<SPAN TYPE="KEYWORD3" DELEGATE="CFSCRIPT">
+		<SPAN TYPE="KEYWORD3" DELEGATE="cfscript::MAIN">
 			<BEGIN><CFSCRIPT</BEGIN>
 			<END></CFSCRIPT></END>
 		</SPAN>
-
+		
+		<!-- query -->
+		<SPAN TYPE="KEYWORD3" DELEGATE="CFQUERY">
+			<BEGIN><CFQUERY</BEGIN>
+			<END>/CFQUERY></END>
+		</SPAN>
+		
 		<!-- CFML markup start tags -->
 		<SPAN TYPE="KEYWORD3" DELEGATE="CFTAGS">
 			<BEGIN><CF</BEGIN>
@@ -59,7 +65,7 @@
 			<BEGIN><STYLE</BEGIN>
 			<END></STYLE></END>
 		</SPAN>
-
+		
 		<!-- markup tags -->
 		<SPAN TYPE="MARKUP" DELEGATE="TAGS">
 			<BEGIN><</BEGIN>
@@ -84,7 +90,7 @@
 		</SPAN>
 
 		<SEQ TYPE="OPERATOR">=</SEQ>
-
+		
 		<!-- CFML markup start tags -->
 		<SPAN TYPE="KEYWORD3" DELEGATE="CFTAGS">
 			<BEGIN><CF</BEGIN>
@@ -96,297 +102,39 @@
 			<BEGIN></CF</BEGIN>
 			<END>></END>
 		</SPAN>
-
-		<!-- CFML markup start tags -->
-		<SPAN TYPE="KEYWORD3" DELEGATE="CFSCRIPT">
-			<BEGIN><CFSCRIPT</BEGIN>
-			<END></CFSCRIPT></END>
-		</SPAN>
 	</RULES>
-
-	<RULES SET="CFSCRIPT" DEFAULT="KEYWORD1" IGNORE_CASE="TRUE" HIGHLIGHT_DIGITS="TRUE">
-
-		<!-- CFSCRIPT multi-line comment -->
-		<SPAN TYPE="COMMENT1">
-			<BEGIN>/*</BEGIN>
-			<END>*/</END>
-		</SPAN>
-
-		<!-- CFSCRIPT single-line comment -->
-		<EOL_SPAN TYPE="COMMENT2">//</EOL_SPAN>
-
-		<SPAN TYPE="LABEL">
+	
+	<RULES SET="CFQUERY" DEFAULT="KEYWORD3" IGNORE_CASE="TRUE" HIGHLIGHT_DIGITS="TRUE">
+		<!-- attributes inside cfquery tag -->
+		<SPAN TYPE="LITERAL1">
 			<BEGIN>"</BEGIN>
 			<END>"</END>
 		</SPAN>
-		<SPAN TYPE="LABEL">
+		<SPAN TYPE="LITERAL1">
 			<BEGIN>'</BEGIN>
 			<END>'</END>
 		</SPAN>
-
-		<SEQ TYPE="LITERAL2">(</SEQ>
-		<SEQ TYPE="LITERAL2">)</SEQ>
-
 		<SEQ TYPE="OPERATOR">=</SEQ>
-		<SEQ TYPE="OPERATOR">+</SEQ>
-		<SEQ TYPE="OPERATOR">-</SEQ>
-		<SEQ TYPE="OPERATOR">/</SEQ>
-		<SEQ TYPE="OPERATOR">>=</SEQ>
-		<SEQ TYPE="OPERATOR"><=</SEQ>
-		<SEQ TYPE="OPERATOR">><</SEQ>
-		<SEQ TYPE="OPERATOR">*</SEQ>
-		<SEQ TYPE="OPERATOR">!!</SEQ>
-		<SEQ TYPE="OPERATOR">&&</SEQ>
-
-		<KEYWORDS>
-			<FUNCTION>{</FUNCTION>
-			<FUNCTION>}</FUNCTION>
-			<FUNCTION>for</FUNCTION>
-			<FUNCTION>while</FUNCTION>
-			<FUNCTION>if</FUNCTION>
-			<FUNCTION>}else</FUNCTION>
-			<FUNCTION>}else{</FUNCTION>
-			<FUNCTION>if(</FUNCTION>
-			<FUNCTION>else</FUNCTION>
-			<FUNCTION>break</FUNCTION>
-
-			<FUNCTION>ArrayAppend</FUNCTION>
-			<FUNCTION>ArrayAvg</FUNCTION>
-			<FUNCTION>ArrayClear</FUNCTION>
-			<FUNCTION>ArrayDeleteAt</FUNCTION>
-			<FUNCTION>ArrayInsertAt</FUNCTION>
-			<FUNCTION>ArrayIsEmpty</FUNCTION>
-			<FUNCTION>ArrayLen</FUNCTION>
-			<FUNCTION>ArrayMax</FUNCTION>
-			<FUNCTION>ArrayMin</FUNCTION>
-			<FUNCTION>ArrayNew</FUNCTION>
-			<FUNCTION>ArrayPrepend</FUNCTION>
-			<FUNCTION>ArrayResize</FUNCTION>
-			<FUNCTION>ArraySet</FUNCTION>
-			<FUNCTION>ArraySort</FUNCTION>
-			<FUNCTION>ArraySum</FUNCTION>
-			<FUNCTION>ArraySwap</FUNCTION>
-			<FUNCTION>ArrayToList</FUNCTION>
-			<FUNCTION>IsArray</FUNCTION>
-			<FUNCTION>ListToArray</FUNCTION>
-
-			<FUNCTION>CreateDate</FUNCTION>
-			<FUNCTION>CreateDateTime</FUNCTION>
-			<FUNCTION>CreateODBCTime</FUNCTION>
-			<FUNCTION>CreateODBCDate</FUNCTION>
-			<FUNCTION>CreateODBCDateTime</FUNCTION>
-			<FUNCTION>CreateTime</FUNCTION>
-			<FUNCTION>CreateTimeSpan</FUNCTION>
-			<FUNCTION>DateAdd</FUNCTION>
-			<FUNCTION>DateCompare</FUNCTION>
-			<FUNCTION>DateDiff</FUNCTION>
-			<FUNCTION>DatePart</FUNCTION>
-			<FUNCTION>Day</FUNCTION>
-			<FUNCTION>DayOfWeek</FUNCTION>
-			<FUNCTION>DayOfWeekAsString</FUNCTION>
-			<FUNCTION>DayOfYear</FUNCTION>
-			<FUNCTION>DaysInMonth</FUNCTION>
-			<FUNCTION>DaysInYear</FUNCTION>
-			<FUNCTION>FirstDayOfMonth</FUNCTION>
-			<FUNCTION>Hour</FUNCTION>
-			<FUNCTION>Minute</FUNCTION>
-			<FUNCTION>Month</FUNCTION>
-			<FUNCTION>MonthAsString</FUNCTION>
-			<FUNCTION>Now</FUNCTION>
-			<FUNCTION>ParseDateTime</FUNCTION>
-			<FUNCTION>Quarter</FUNCTION>
-			<FUNCTION>Second</FUNCTION>
-			<FUNCTION>Week</FUNCTION>
-			<FUNCTION>Year</FUNCTION>
-
-			<FUNCTION>IsArray</FUNCTION>
-			<FUNCTION>IsAuthenticated</FUNCTION>
-			<FUNCTION>IsAuthorized</FUNCTION>
-			<FUNCTION>IsBoolean</FUNCTION>
-			<FUNCTION>IsDate</FUNCTION>
-			<FUNCTION>IsDebugMode</FUNCTION>
-			<FUNCTION>IsDefined</FUNCTION>
-			<FUNCTION>IsLeapYear</FUNCTION>
-			<FUNCTION>IsNumeric</FUNCTION>
-			<FUNCTION>IsNumericDate</FUNCTION>
-			<FUNCTION>IsQuery</FUNCTION>
-			<FUNCTION>IsSimpleValue</FUNCTION>
-			<FUNCTION>IsStruct</FUNCTION>
-
-			<FUNCTION>DateFormat</FUNCTION>
-			<FUNCTION>DecimalFormat</FUNCTION>
-			<FUNCTION>DollarFormat</FUNCTION>
-			<FUNCTION>FormatBaseN</FUNCTION>
-			<FUNCTION>HTMLCodeFormat</FUNCTION>
-			<FUNCTION>HTMLEditFormat</FUNCTION>
-			<FUNCTION>NumberFormat</FUNCTION>
-			<FUNCTION>ParagraphFormat</FUNCTION>
-			<FUNCTION>TimeFormat</FUNCTION>
-			<FUNCTION>YesNoFormat</FUNCTION>
-
-			<FUNCTION>DE</FUNCTION>
-			<FUNCTION>Evaluate</FUNCTION>
-			<FUNCTION>IIf</FUNCTION>
-			<FUNCTION>SetVariable</FUNCTION>
-
-			<FUNCTION>ArrayToList</FUNCTION>
-			<FUNCTION>ListAppend</FUNCTION>
-			<FUNCTION>ListChangeDelims</FUNCTION>
-			<FUNCTION>ListContains</FUNCTION>
-			<FUNCTION>ListContainsNoCase</FUNCTION>
-			<FUNCTION>ListDeleteAt</FUNCTION>
-			<FUNCTION>ListFind</FUNCTION>
-			<FUNCTION>ListFindNoCase</FUNCTION>
-			<FUNCTION>ListFirst</FUNCTION>
-			<FUNCTION>ListGetAt</FUNCTION>
-			<FUNCTION>ListInsertAt</FUNCTION>
-			<FUNCTION>ListLast</FUNCTION>
-			<FUNCTION>ListLen</FUNCTION>
-			<FUNCTION>ListPrepend</FUNCTION>
-			<FUNCTION>ListRest</FUNCTION>
-			<FUNCTION>ListSetAt</FUNCTION>
-			<FUNCTION>ListToArray</FUNCTION>
-
-			<FUNCTION>StructClear</FUNCTION>
-			<FUNCTION>StructCopy</FUNCTION>
-			<FUNCTION>StructCount</FUNCTION>
-			<FUNCTION>StructDelete</FUNCTION>
-			<FUNCTION>StructFind</FUNCTION>
-			<FUNCTION>StructInsert</FUNCTION>
-			<FUNCTION>StructIsEmpty</FUNCTION>
-			<FUNCTION>StructKeyExists</FUNCTION>
-			<FUNCTION>StructNew</FUNCTION>
-			<FUNCTION>StructUpdate</FUNCTION>
-
-			<FUNCTION>GetLocale</FUNCTION>
-			<FUNCTION>LSCurrencyFormat</FUNCTION>
-			<FUNCTION>LSDateFormat</FUNCTION>
-			<FUNCTION>LSIsCurrency</FUNCTION>
-			<FUNCTION>LSIsDate</FUNCTION>
-			<FUNCTION>LSIsNumeric</FUNCTION>
-			<FUNCTION>LSNumberFormat</FUNCTION>
-			<FUNCTION>LSParseCurrency</FUNCTION>
-			<FUNCTION>LSParseDateTime</FUNCTION>
-			<FUNCTION>LSParseNumber</FUNCTION>
-			<FUNCTION>LSTimeFormat</FUNCTION>
-			<FUNCTION>SetLocale</FUNCTION>
-
-			<FUNCTION>Abs</FUNCTION>
-			<FUNCTION>Atn</FUNCTION>
-			<FUNCTION>BitAnd</FUNCTION>
-			<FUNCTION>BitMaskClear</FUNCTION>
-			<FUNCTION>BitMaskRead</FUNCTION>
-			<FUNCTION>BitMaskSet</FUNCTION>
-			<FUNCTION>BitNot</FUNCTION>
-			<FUNCTION>BitOr</FUNCTION>
-			<FUNCTION>BitSHLN</FUNCTION>
-			<FUNCTION>BitSHRN</FUNCTION>
-			<FUNCTION>BitXor</FUNCTION>
-			<FUNCTION>Ceiling</FUNCTION>
-			<FUNCTION>Cos</FUNCTION>
-			<FUNCTION>DecrementValue</FUNCTION>
-			<FUNCTION>Exp</FUNCTION>
-			<FUNCTION>Fix</FUNCTION>
-			<FUNCTION>IncrementValue</FUNCTION>
-			<FUNCTION>InputBaseN</FUNCTION>
-			<FUNCTION>Int</FUNCTION>
-			<FUNCTION>Log</FUNCTION>
-			<FUNCTION>Log10</FUNCTION>
-			<FUNCTION>Max</FUNCTION>
-			<FUNCTION>Min</FUNCTION>
-			<FUNCTION>Pi</FUNCTION>
-			<FUNCTION>Rand</FUNCTION>
-			<FUNCTION>Randomize</FUNCTION>
-			<FUNCTION>RandRange</FUNCTION>
-			<FUNCTION>Round</FUNCTION>
-			<FUNCTION>Sgn</FUNCTION>
-			<FUNCTION>Sin</FUNCTION>
-			<FUNCTION>Sqr</FUNCTION>
-			<FUNCTION>Tan</FUNCTION>
-
-			<FUNCTION>Asc</FUNCTION>
-			<FUNCTION>Chr</FUNCTION>
-			<FUNCTION>CJustify</FUNCTION>
-			<FUNCTION>Compare</FUNCTION>
-			<FUNCTION>CompareNoCase</FUNCTION>
-			<FUNCTION>Find</FUNCTION>
-			<FUNCTION>FindNoCase</FUNCTION>
-			<FUNCTION>FindOneOf</FUNCTION>
-			<FUNCTION>GetToken</FUNCTION>
-			<FUNCTION>Insert</FUNCTION>
-			<FUNCTION>LCase</FUNCTION>
-			<FUNCTION>Left</FUNCTION>
-			<FUNCTION>Len</FUNCTION>
-			<FUNCTION>LJustify</FUNCTION>
-			<FUNCTION>LTrim</FUNCTION>
-			<FUNCTION>Mid</FUNCTION>
-			<FUNCTION>REFind</FUNCTION>
-			<FUNCTION>REFindNoCase</FUNCTION>
-			<FUNCTION>RemoveChars</FUNCTION>
-			<FUNCTION>RepeatString</FUNCTION>
-			<FUNCTION>Replace</FUNCTION>
-			<FUNCTION>ReplaceList</FUNCTION>
-			<FUNCTION>ReplaceNoCase</FUNCTION>
-			<FUNCTION>REReplace</FUNCTION>
-			<FUNCTION>REReplaceNoCase</FUNCTION>
-			<FUNCTION>Reverse</FUNCTION>
-			<FUNCTION>Right</FUNCTION>
-			<FUNCTION>RJustify</FUNCTION>
-			<FUNCTION>RTrim</FUNCTION>
-			<FUNCTION>SpanExcluding</FUNCTION>
-			<FUNCTION>SpanIncluding</FUNCTION>
-			<FUNCTION>Trim</FUNCTION>
-			<FUNCTION>UCase</FUNCTION>
-			<FUNCTION>Val</FUNCTION>
-
-			<FUNCTION>DirectoryExists</FUNCTION>
-			<FUNCTION>ExpandPath</FUNCTION>
-			<FUNCTION>FileExists</FUNCTION>
-			<FUNCTION>GetDirectoryFromPath</FUNCTION>
-			<FUNCTION>GetFileFromPath</FUNCTION>
-			<FUNCTION>GetTempDirectory</FUNCTION>
-			<FUNCTION>GetTempFile</FUNCTION>
-			<FUNCTION>GetTemplatePath</FUNCTION>
-
-			<FUNCTION>QueryAddRow</FUNCTION>
-			<FUNCTION>QueryNew</FUNCTION>
-			<FUNCTION>QuerySetCell</FUNCTION>
-
-			<FUNCTION>Decrypt</FUNCTION>
-			<FUNCTION>DeleteClientVariable</FUNCTION>
-			<FUNCTION>Encrypt</FUNCTION>
-			<FUNCTION>GetBaseTagData</FUNCTION>
-			<FUNCTION>GetBaseTagList</FUNCTION>
-			<FUNCTION>GetClientVariablesList</FUNCTION>
-			<FUNCTION>GetTickCount</FUNCTION>
-			<FUNCTION>PreserveSingleQuotes</FUNCTION>
-			<FUNCTION>QuotedValueList</FUNCTION>
-			<FUNCTION>StripCR</FUNCTION>
-			<FUNCTION>URLEncodedFormat</FUNCTION>
-			<FUNCTION>ValueList</FUNCTION>
-			<FUNCTION>WriteOutput</FUNCTION>
-
-			<FUNCTION>ParameterExists</FUNCTION>
-
-			<OPERATOR>IS</OPERATOR>
-			<OPERATOR>EQ</OPERATOR>
-			<OPERATOR>NEQ</OPERATOR>
-			<OPERATOR>GT</OPERATOR>
-			<OPERATOR>GTE</OPERATOR>
-			<OPERATOR>LT</OPERATOR>
-			<OPERATOR>LTE</OPERATOR>
-
-			<OPERATOR>LESS</OPERATOR>
-			<OPERATOR>GREATER</OPERATOR>
-			<OPERATOR>THAN</OPERATOR>
-
-			<OPERATOR>AND</OPERATOR>
-			<OPERATOR>OR</OPERATOR>
-			<OPERATOR>NOT</OPERATOR>
-			<OPERATOR>XOR</OPERATOR>
-		</KEYWORDS>
+		
+		<!-- cf logic inside query (like <cfqueryparam.../> -->
+		<SPAN_REGEXP TYPE="KEYWORD3" DELEGATE="CFTAGS" HASH_CHARS="<CF">
+			<BEGIN><CF</BEGIN>
+			<END>></END>
+		</SPAN_REGEXP>
+		
+		<!-- ending cf tag in query (like </cfif> ) -->
+		<SPAN_REGEXP TYPE="KEYWORD3" DELEGATE="CFTAGS" HASH_CHARS="</CF">
+			<BEGIN></CF</BEGIN>
+			<END>></END>
+		</SPAN_REGEXP>
+		
+		<!-- the actual SQL, delegate -->
+		<SPAN TYPE="MARKUP" DELEGATE="transact-sql::MAIN">
+			<BEGIN>></BEGIN>
+			<END><</END>
+		</SPAN>
 	</RULES>
-
+	
 	<RULES SET="CFTAGS" DEFAULT="KEYWORD3">
 		<SPAN TYPE="LITERAL1">
 			<BEGIN>"</BEGIN>
@@ -404,13 +152,33 @@
 			<BEGIN>#</BEGIN>
 			<END>#</END>
 		</SPAN>
-
+		
+		<!-- Allow arbitrary CFScript in CFSET tags (buggy) -->
+		<!--SPAN TYPE="KEYWORD3" DELEGATE="cfscript::MAIN">
+			<BEGIN>SET </BEGIN>
+			<END>></END>
+		</SPAN-->
+		
 		<KEYWORDS>
+			<KEYWORD2>ACos</KEYWORD2>
+			<KEYWORD2>ASin</KEYWORD2>
+			<KEYWORD2>Abort</KEYWORD2>
+			<KEYWORD2>Abs</KEYWORD2>
+			<KEYWORD2>AddSOAPRequestHeader</KEYWORD2>
+			<KEYWORD2>AddSOAPResponseHeader</KEYWORD2>
+			<KEYWORD2>AjaxLink</KEYWORD2>
+			<KEYWORD2>AjaxOnLoad</KEYWORD2>
+			<KEYWORD2>ApplicationStop</KEYWORD2>
 			<KEYWORD2>ArrayAppend</KEYWORD2>
 			<KEYWORD2>ArrayAvg</KEYWORD2>
 			<KEYWORD2>ArrayClear</KEYWORD2>
+			<KEYWORD2>ArrayContains</KEYWORD2>
+			<KEYWORD2>ArrayDelete</KEYWORD2>
 			<KEYWORD2>ArrayDeleteAt</KEYWORD2>
+			<KEYWORD2>ArrayFind</KEYWORD2>
+			<KEYWORD2>ArrayFindNoCase</KEYWORD2>
 			<KEYWORD2>ArrayInsertAt</KEYWORD2>
+			<KEYWORD2>ArrayIsDefined</KEYWORD2>
 			<KEYWORD2>ArrayIsEmpty</KEYWORD2>
 			<KEYWORD2>ArrayLen</KEYWORD2>
 			<KEYWORD2>ArrayMax</KEYWORD2>
@@ -423,19 +191,50 @@
 			<KEYWORD2>ArraySum</KEYWORD2>
 			<KEYWORD2>ArraySwap</KEYWORD2>
 			<KEYWORD2>ArrayToList</KEYWORD2>
-			<KEYWORD2>IsArray</KEYWORD2>
-			<KEYWORD2>ListToArray</KEYWORD2>
-
+			<KEYWORD2>Asc</KEYWORD2>
+			<KEYWORD2>Atn</KEYWORD2>
+			<KEYWORD2>BinaryDecode</KEYWORD2>
+			<KEYWORD2>BinaryEncode</KEYWORD2>
+			<KEYWORD2>BitAnd</KEYWORD2>
+			<KEYWORD2>BitMaskClear</KEYWORD2>
+			<KEYWORD2>BitMaskRead</KEYWORD2>
+			<KEYWORD2>BitMaskSet</KEYWORD2>
+			<KEYWORD2>BitNot</KEYWORD2>
+			<KEYWORD2>BitOr</KEYWORD2>
+			<KEYWORD2>BitSHLN</KEYWORD2>
+			<KEYWORD2>BitSHRN</KEYWORD2>
+			<KEYWORD2>BitXor</KEYWORD2>
+			<KEYWORD2>CJustify</KEYWORD2>
+			<KEYWORD2>CacheGet</KEYWORD2>
+			<KEYWORD2>CacheGetAllIds</KEYWORD2>
+			<KEYWORD2>CacheGetMetadata</KEYWORD2>
+			<KEYWORD2>CacheGetProperties</KEYWORD2>
+			<KEYWORD2>CacheGetSession</KEYWORD2>
+			<KEYWORD2>CachePut</KEYWORD2>
+			<KEYWORD2>CacheRemove</KEYWORD2>
+			<KEYWORD2>CacheSetProperties</KEYWORD2>
+			<KEYWORD2>Ceiling</KEYWORD2>
+			<KEYWORD2>CharsetDecode</KEYWORD2>
+			<KEYWORD2>CharsetEncode</KEYWORD2>
+			<KEYWORD2>Chr</KEYWORD2>
+			<KEYWORD2>Compare</KEYWORD2>
+			<KEYWORD2>CompareNoCase</KEYWORD2>
+			<KEYWORD2>Cos</KEYWORD2>
 			<KEYWORD2>CreateDate</KEYWORD2>
 			<KEYWORD2>CreateDateTime</KEYWORD2>
-			<KEYWORD2>CreateODBCTime</KEYWORD2>
 			<KEYWORD2>CreateODBCDate</KEYWORD2>
 			<KEYWORD2>CreateODBCDateTime</KEYWORD2>
+			<KEYWORD2>CreateODBCTime</KEYWORD2>
+			<KEYWORD2>CreateObject</KEYWORD2>
 			<KEYWORD2>CreateTime</KEYWORD2>
 			<KEYWORD2>CreateTimeSpan</KEYWORD2>
+			<KEYWORD2>CreateUUID</KEYWORD2>
+			<KEYWORD2>DE</KEYWORD2>
 			<KEYWORD2>DateAdd</KEYWORD2>
 			<KEYWORD2>DateCompare</KEYWORD2>
+			<KEYWORD2>DateConvert</KEYWORD2>
 			<KEYWORD2>DateDiff</KEYWORD2>
+			<KEYWORD2>DateFormat</KEYWORD2>
 			<KEYWORD2>DatePart</KEYWORD2>
 			<KEYWORD2>Day</KEYWORD2>
 			<KEYWORD2>DayOfWeek</KEYWORD2>
@@ -443,49 +242,213 @@
 			<KEYWORD2>DayOfYear</KEYWORD2>
 			<KEYWORD2>DaysInMonth</KEYWORD2>
 			<KEYWORD2>DaysInYear</KEYWORD2>
+			<KEYWORD2>DecimalFormat</KEYWORD2>
+			<KEYWORD2>DecrementValue</KEYWORD2>
+			<KEYWORD2>Decrypt</KEYWORD2>
+			<KEYWORD2>DecryptBinary</KEYWORD2>
+			<KEYWORD2>DeleteClientVariable</KEYWORD2>
+			<KEYWORD2>DeserializeJSON</KEYWORD2>
+			<KEYWORD2>DirectoryCreate</KEYWORD2>
+			<KEYWORD2>DirectoryDelete</KEYWORD2>
+			<KEYWORD2>DirectoryExists</KEYWORD2>
+			<KEYWORD2>DirectoryList</KEYWORD2>
+			<KEYWORD2>DirectoryRename</KEYWORD2>
+			<KEYWORD2>DollarFormat</KEYWORD2>
+			<KEYWORD2>DotNetToCFType</KEYWORD2>
+			<KEYWORD2>Duplicate</KEYWORD2>
+			<KEYWORD2>Encrypt</KEYWORD2>
+			<KEYWORD2>EncryptBinary</KEYWORD2>
+			<KEYWORD2>EntityDelete</KEYWORD2>
+			<KEYWORD2>EntityLoad</KEYWORD2>
+			<KEYWORD2>EntityLoadByExample</KEYWORD2>
+			<KEYWORD2>EntityLoadByPK</KEYWORD2>
+			<KEYWORD2>EntityMerge</KEYWORD2>
+			<KEYWORD2>EntityNew</KEYWORD2>
+			<KEYWORD2>EntityReload</KEYWORD2>
+			<KEYWORD2>EntitySave</KEYWORD2>
+			<KEYWORD2>EntitytoQuery</KEYWORD2>
+			<KEYWORD2>Evaluate</KEYWORD2>
+			<KEYWORD2>Exp</KEYWORD2>
+			<KEYWORD2>ExpandPath</KEYWORD2>
+			<KEYWORD2>FileClose</KEYWORD2>
+			<KEYWORD2>FileCopy</KEYWORD2>
+			<KEYWORD2>FileDelete</KEYWORD2>
+			<KEYWORD2>FileExists</KEYWORD2>
+			<KEYWORD2>FileIsEOF</KEYWORD2>
+			<KEYWORD2>FileMove</KEYWORD2>
+			<KEYWORD2>FileOpen</KEYWORD2>
+			<KEYWORD2>FileRead</KEYWORD2>
+			<KEYWORD2>FileReadBinary</KEYWORD2>
+			<KEYWORD2>FileReadLine</KEYWORD2>
+			<KEYWORD2>FileSeek</KEYWORD2>
+			<KEYWORD2>FileSetAccessMode</KEYWORD2>
+			<KEYWORD2>FileSetAttribute</KEYWORD2>
+			<KEYWORD2>FileSetLastModified</KEYWORD2>
+			<KEYWORD2>FileSkipBytes</KEYWORD2>
+			<KEYWORD2>FileUpload</KEYWORD2>
+			<KEYWORD2>FileUploadAll</KEYWORD2>
+			<KEYWORD2>FileWrite</KEYWORD2>
+			<KEYWORD2>Find</KEYWORD2>
+			<KEYWORD2>FindNoCase</KEYWORD2>
+			<KEYWORD2>FindOneOf</KEYWORD2>
 			<KEYWORD2>FirstDayOfMonth</KEYWORD2>
+			<KEYWORD2>Fix</KEYWORD2>
+			<KEYWORD2>FormatBaseN</KEYWORD2>
+			<KEYWORD2>GenerateSecretKey</KEYWORD2>
+			<KEYWORD2>GetAuthUser</KEYWORD2>
+			<KEYWORD2>GetBaseTagData</KEYWORD2>
+			<KEYWORD2>GetBaseTagList</KEYWORD2>
+			<KEYWORD2>GetBaseTemplatePath</KEYWORD2>
+			<KEYWORD2>GetClientVariablesList</KEYWORD2>
+			<KEYWORD2>GetComponentMetaData</KEYWORD2>
+			<KEYWORD2>GetContextRoot</KEYWORD2>
+			<KEYWORD2>GetCurrentTemplatePath</KEYWORD2>
+			<KEYWORD2>GetDirectoryFromPath</KEYWORD2>
+			<KEYWORD2>GetEncoding</KEYWORD2>
+			<KEYWORD2>GetException</KEYWORD2>
+			<KEYWORD2>GetFileFromPath</KEYWORD2>
+			<KEYWORD2>GetFileInfo</KEYWORD2>
+			<KEYWORD2>GetFunctionCalledName</KEYWORD2>
+			<KEYWORD2>GetFunctionList</KEYWORD2>
+			<KEYWORD2>GetGatewayHelper</KEYWORD2>
+			<KEYWORD2>GetHttpRequestData</KEYWORD2>
+			<KEYWORD2>GetHttpTimeString</KEYWORD2>
+			<KEYWORD2>GetLocalHostIP</KEYWORD2>
+			<KEYWORD2>GetLocale</KEYWORD2>
+			<KEYWORD2>GetLocaleDisplayName</KEYWORD2>
+			<KEYWORD2>GetMetaData</KEYWORD2>
+			<KEYWORD2>GetMetricData</KEYWORD2>
+			<KEYWORD2>GetPageContext</KEYWORD2>
+			<KEYWORD2>GetPrinterInfo</KEYWORD2>
+			<KEYWORD2>GetProfileSections</KEYWORD2>
+			<KEYWORD2>GetProfileString</KEYWORD2>
+			<KEYWORD2>GetReadableImageFormats</KEYWORD2>
+			<KEYWORD2>GetSOAPRequest</KEYWORD2>
+			<KEYWORD2>GetSOAPRequestHeader</KEYWORD2>
+			<KEYWORD2>GetSOAPResponse</KEYWORD2>
+			<KEYWORD2>GetSOAPResponseHeader</KEYWORD2>
+			<KEYWORD2>GetTempDirectory</KEYWORD2>
+			<KEYWORD2>GetTempFile</KEYWORD2>
+			<KEYWORD2>GetTemplatePath</KEYWORD2>
+			<KEYWORD2>GetTickCount</KEYWORD2>
+			<KEYWORD2>GetTimeZoneInfo</KEYWORD2>
+			<KEYWORD2>GetToken</KEYWORD2>
+			<KEYWORD2>GetUserRoles</KEYWORD2>
+			<KEYWORD2>GetWriteableImageFormats</KEYWORD2>
+			<KEYWORD2>HTMLCodeFormat</KEYWORD2>
+			<KEYWORD2>HTMLEditFormat</KEYWORD2>
+			<KEYWORD2>Hash</KEYWORD2>
 			<KEYWORD2>Hour</KEYWORD2>
-			<KEYWORD2>Minute</KEYWORD2>
-			<KEYWORD2>Month</KEYWORD2>
-			<KEYWORD2>MonthAsString</KEYWORD2>
-			<KEYWORD2>Now</KEYWORD2>
-			<KEYWORD2>ParseDateTime</KEYWORD2>
-			<KEYWORD2>Quarter</KEYWORD2>
-			<KEYWORD2>Second</KEYWORD2>
-			<KEYWORD2>Week</KEYWORD2>
-			<KEYWORD2>Year</KEYWORD2>
-
+			<KEYWORD2>IIf</KEYWORD2>
+			<KEYWORD2>ImageAddBorder</KEYWORD2>
+			<KEYWORD2>ImageBlur</KEYWORD2>
+			<KEYWORD2>ImageClearRect</KEYWORD2>
+			<KEYWORD2>ImageCopy</KEYWORD2>
+			<KEYWORD2>ImageCrop</KEYWORD2>
+			<KEYWORD2>ImageDrawArc</KEYWORD2>
+			<KEYWORD2>ImageDrawBeveledRect</KEYWORD2>
+			<KEYWORD2>ImageDrawCubicCurve</KEYWORD2>
+			<KEYWORD2>ImageDrawLine</KEYWORD2>
+			<KEYWORD2>ImageDrawLines</KEYWORD2>
+			<KEYWORD2>ImageDrawOval</KEYWORD2>
+			<KEYWORD2>ImageDrawPoint</KEYWORD2>
+			<KEYWORD2>ImageDrawQuadraticCurve</KEYWORD2>
+			<KEYWORD2>ImageDrawRect</KEYWORD2>
+			<KEYWORD2>ImageDrawRoundRect</KEYWORD2>
+			<KEYWORD2>ImageDrawText</KEYWORD2>
+			<KEYWORD2>ImageFlip</KEYWORD2>
+			<KEYWORD2>ImageGetBlob</KEYWORD2>
+			<KEYWORD2>ImageGetBufferedImage</KEYWORD2>
+			<KEYWORD2>ImageGetEXIFTag</KEYWORD2>
+			<KEYWORD2>ImageGetHeight</KEYWORD2>
+			<KEYWORD2>ImageGetIPTCTag</KEYWORD2>
+			<KEYWORD2>ImageGetWidth</KEYWORD2>
+			<KEYWORD2>ImageGrayscale</KEYWORD2>
+			<KEYWORD2>ImageInfo</KEYWORD2>
+			<KEYWORD2>ImageNegative</KEYWORD2>
+			<KEYWORD2>ImageNew</KEYWORD2>
+			<KEYWORD2>ImageOverlay</KEYWORD2>
+			<KEYWORD2>ImagePaste</KEYWORD2>
+			<KEYWORD2>ImageRead</KEYWORD2>
+			<KEYWORD2>ImageReadBase64</KEYWORD2>
+			<KEYWORD2>ImageResize</KEYWORD2>
+			<KEYWORD2>ImageRotate</KEYWORD2>
+			<KEYWORD2>ImageRotateDrawingAxis</KEYWORD2>
+			<KEYWORD2>ImageScaleToFit</KEYWORD2>
+			<KEYWORD2>ImageSetAntialiasing</KEYWORD2>
+			<KEYWORD2>ImageSetBackgroundColor</KEYWORD2>
+			<KEYWORD2>ImageSetDrawingColor</KEYWORD2>
+			<KEYWORD2>ImageSetDrawingStroke</KEYWORD2>
+			<KEYWORD2>ImageSetDrawingTransparency</KEYWORD2>
+			<KEYWORD2>ImageSharpen</KEYWORD2>
+			<KEYWORD2>ImageShear</KEYWORD2>
+			<KEYWORD2>ImageShearDrawingAxis</KEYWORD2>
+			<KEYWORD2>ImageTranslate</KEYWORD2>
+			<KEYWORD2>ImageTranslateDrawingAxis</KEYWORD2>
+			<KEYWORD2>ImageWrite</KEYWORD2>
+			<KEYWORD2>ImageWriteBase64</KEYWORD2>
+			<KEYWORD2>ImageXORDrawingMode</KEYWORD2>
+			<KEYWORD2>IncrementValue</KEYWORD2>
+			<KEYWORD2>InputBaseN</KEYWORD2>
+			<KEYWORD2>Insert</KEYWORD2>
+			<KEYWORD2>Int</KEYWORD2>
 			<KEYWORD2>IsArray</KEYWORD2>
-			<KEYWORD2>IsAuthenticated</KEYWORD2>
-			<KEYWORD2>IsAuthorized</KEYWORD2>
+			<KEYWORD2>IsBinary</KEYWORD2>
 			<KEYWORD2>IsBoolean</KEYWORD2>
+			<KEYWORD2>IsCustomFunction</KEYWORD2>
+			<KEYWORD2>IsDDX</KEYWORD2>
 			<KEYWORD2>IsDate</KEYWORD2>
 			<KEYWORD2>IsDebugMode</KEYWORD2>
 			<KEYWORD2>IsDefined</KEYWORD2>
+			<KEYWORD2>IsImage</KEYWORD2>
+			<KEYWORD2>IsImageFile</KEYWORD2>
+			<KEYWORD2>IsInstanceOf</KEYWORD2>
+			<KEYWORD2>IsJSON</KEYWORD2>
+			<KEYWORD2>IsK2ServerABroker</KEYWORD2>
+			<KEYWORD2>IsK2ServerDocCountExceeded</KEYWORD2>
+			<KEYWORD2>IsK2ServerOnline</KEYWORD2>
 			<KEYWORD2>IsLeapYear</KEYWORD2>
+			<KEYWORD2>IsLocalHost</KEYWORD2>
+			<KEYWORD2>IsNull</KEYWORD2>
 			<KEYWORD2>IsNumeric</KEYWORD2>
 			<KEYWORD2>IsNumericDate</KEYWORD2>
+			<KEYWORD2>IsObject</KEYWORD2>
+			<KEYWORD2>IsPDFFile</KEYWORD2>
+			<KEYWORD2>IsPDFObject</KEYWORD2>
 			<KEYWORD2>IsQuery</KEYWORD2>
+			<KEYWORD2>IsSOAPRequest</KEYWORD2>
 			<KEYWORD2>IsSimpleValue</KEYWORD2>
 			<KEYWORD2>IsStruct</KEYWORD2>
-
-			<KEYWORD2>DateFormat</KEYWORD2>
-			<KEYWORD2>DecimalFormat</KEYWORD2>
-			<KEYWORD2>DollarFormat</KEYWORD2>
-			<KEYWORD2>FormatBaseN</KEYWORD2>
-			<KEYWORD2>HTMLCodeFormat</KEYWORD2>
-			<KEYWORD2>HTMLEditFormat</KEYWORD2>
-			<KEYWORD2>NumberFormat</KEYWORD2>
-			<KEYWORD2>ParagraphFormat</KEYWORD2>
-			<KEYWORD2>TimeFormat</KEYWORD2>
-			<KEYWORD2>YesNoFormat</KEYWORD2>
-
-			<KEYWORD2>DE</KEYWORD2>
-			<KEYWORD2>Evaluate</KEYWORD2>
-			<KEYWORD2>IIf</KEYWORD2>
-			<KEYWORD2>SetVariable</KEYWORD2>
-
-			<KEYWORD2>ArrayToList</KEYWORD2>
+			<KEYWORD2>IsUserInAnyRole</KEYWORD2>
+			<KEYWORD2>IsUserInRole</KEYWORD2>
+			<KEYWORD2>IsUserLoggedIn</KEYWORD2>
+			<KEYWORD2>IsValid</KEYWORD2>
+			<KEYWORD2>IsWDDX</KEYWORD2>
+			<KEYWORD2>IsXML</KEYWORD2>
+			<KEYWORD2>IsXmlAttribute</KEYWORD2>
+			<KEYWORD2>IsXmlDoc</KEYWORD2>
+			<KEYWORD2>IsXmlElem</KEYWORD2>
+			<KEYWORD2>IsXmlNode</KEYWORD2>
+			<KEYWORD2>IsXmlRoot</KEYWORD2>
+			<KEYWORD2>JSStringFormat</KEYWORD2>
+			<KEYWORD2>JavaCast</KEYWORD2>
+			<KEYWORD2>LCase</KEYWORD2>
+			<KEYWORD2>LJustify</KEYWORD2>
+			<KEYWORD2>LSCurrencyFormat</KEYWORD2>
+			<KEYWORD2>LSDateFormat</KEYWORD2>
+			<KEYWORD2>LSEuroCurrencyFormat</KEYWORD2>
+			<KEYWORD2>LSIsCurrency</KEYWORD2>
+			<KEYWORD2>LSIsDate</KEYWORD2>
+			<KEYWORD2>LSIsNumeric</KEYWORD2>
+			<KEYWORD2>LSNumberFormat</KEYWORD2>
+			<KEYWORD2>LSParseCurrency</KEYWORD2>
+			<KEYWORD2>LSParseDateTime</KEYWORD2>
+			<KEYWORD2>LSParseEuroCurrency</KEYWORD2>
+			<KEYWORD2>LSParseNumber</KEYWORD2>
+			<KEYWORD2>LSTimeFormat</KEYWORD2>
+			<KEYWORD2>LTrim</KEYWORD2>
+			<KEYWORD2>Left</KEYWORD2>
+			<KEYWORD2>Len</KEYWORD2>
 			<KEYWORD2>ListAppend</KEYWORD2>
 			<KEYWORD2>ListChangeDelims</KEYWORD2>
 			<KEYWORD2>ListContains</KEYWORD2>
@@ -499,130 +462,173 @@
 			<KEYWORD2>ListLast</KEYWORD2>
 			<KEYWORD2>ListLen</KEYWORD2>
 			<KEYWORD2>ListPrepend</KEYWORD2>
+			<KEYWORD2>ListQualify</KEYWORD2>
 			<KEYWORD2>ListRest</KEYWORD2>
 			<KEYWORD2>ListSetAt</KEYWORD2>
+			<KEYWORD2>ListSort</KEYWORD2>
 			<KEYWORD2>ListToArray</KEYWORD2>
-
-			<KEYWORD2>StructClear</KEYWORD2>
-			<KEYWORD2>StructCopy</KEYWORD2>
-			<KEYWORD2>StructCount</KEYWORD2>
-			<KEYWORD2>StructDelete</KEYWORD2>
-			<KEYWORD2>StructFind</KEYWORD2>
-			<KEYWORD2>StructInsert</KEYWORD2>
-			<KEYWORD2>StructIsEmpty</KEYWORD2>
-			<KEYWORD2>StructKeyExists</KEYWORD2>
-			<KEYWORD2>StructNew</KEYWORD2>
-			<KEYWORD2>StructUpdate</KEYWORD2>
-
-			<KEYWORD2>GetLocale</KEYWORD2>
-			<KEYWORD2>LSCurrencyFormat</KEYWORD2>
-			<KEYWORD2>LSDateFormat</KEYWORD2>
-			<KEYWORD2>LSIsCurrency</KEYWORD2>
-			<KEYWORD2>LSIsDate</KEYWORD2>
-			<KEYWORD2>LSIsNumeric</KEYWORD2>
-			<KEYWORD2>LSNumberFormat</KEYWORD2>
-			<KEYWORD2>LSParseCurrency</KEYWORD2>
-			<KEYWORD2>LSParseDateTime</KEYWORD2>
-			<KEYWORD2>LSParseNumber</KEYWORD2>
-			<KEYWORD2>LSTimeFormat</KEYWORD2>
-			<KEYWORD2>SetLocale</KEYWORD2>
-
-			<KEYWORD2>Abs</KEYWORD2>
-			<KEYWORD2>Atn</KEYWORD2>
-			<KEYWORD2>BitAnd</KEYWORD2>
-			<KEYWORD2>BitMaskClear</KEYWORD2>
-			<KEYWORD2>BitMaskRead</KEYWORD2>
-			<KEYWORD2>BitMaskSet</KEYWORD2>
-			<KEYWORD2>BitNot</KEYWORD2>
-			<KEYWORD2>BitOr</KEYWORD2>
-			<KEYWORD2>BitSHLN</KEYWORD2>
-			<KEYWORD2>BitSHRN</KEYWORD2>
-			<KEYWORD2>BitXor</KEYWORD2>
-			<KEYWORD2>Ceiling</KEYWORD2>
-			<KEYWORD2>Cos</KEYWORD2>
-			<KEYWORD2>DecrementValue</KEYWORD2>
-			<KEYWORD2>Exp</KEYWORD2>
-			<KEYWORD2>Fix</KEYWORD2>
-			<KEYWORD2>IncrementValue</KEYWORD2>
-			<KEYWORD2>InputBaseN</KEYWORD2>
-			<KEYWORD2>Int</KEYWORD2>
+			<KEYWORD2>ListValueCount</KEYWORD2>
+			<KEYWORD2>ListValueCountNoCase</KEYWORD2>
+			<KEYWORD2>Location</KEYWORD2>
 			<KEYWORD2>Log</KEYWORD2>
 			<KEYWORD2>Log10</KEYWORD2>
 			<KEYWORD2>Max</KEYWORD2>
+			<KEYWORD2>Mid</KEYWORD2>
 			<KEYWORD2>Min</KEYWORD2>
+			<KEYWORD2>Minute</KEYWORD2>
+			<KEYWORD2>Month</KEYWORD2>
+			<KEYWORD2>MonthAsString</KEYWORD2>
+			<KEYWORD2>Now</KEYWORD2>
+			<KEYWORD2>NumberFormat</KEYWORD2>
+			<KEYWORD2>ORMClearSession</KEYWORD2>
+			<KEYWORD2>ORMCloseSession</KEYWORD2>
+			<KEYWORD2>ORMEvictCollection</KEYWORD2>
+			<KEYWORD2>ORMEvictEntity</KEYWORD2>
+			<KEYWORD2>ORMEvictQueries</KEYWORD2>
+			<KEYWORD2>ORMExecuteQuery</KEYWORD2>
+			<KEYWORD2>ORMFlush</KEYWORD2>
+			<KEYWORD2>ORMGetSession</KEYWORD2>
+			<KEYWORD2>ORMGetSessionFactory</KEYWORD2>
+			<KEYWORD2>ORMReload</KEYWORD2>
+			<KEYWORD2>ObjectEquals</KEYWORD2>
+			<KEYWORD2>ObjectLoad</KEYWORD2>
+			<KEYWORD2>ObjectSave</KEYWORD2>
+			<KEYWORD2>ParagraphFormat</KEYWORD2>
+			<KEYWORD2>ParseDateTime</KEYWORD2>
 			<KEYWORD2>Pi</KEYWORD2>
-			<KEYWORD2>Rand</KEYWORD2>
-			<KEYWORD2>Randomize</KEYWORD2>
-			<KEYWORD2>RandRange</KEYWORD2>
-			<KEYWORD2>Round</KEYWORD2>
-			<KEYWORD2>Sgn</KEYWORD2>
-			<KEYWORD2>Sin</KEYWORD2>
-			<KEYWORD2>Sqr</KEYWORD2>
-			<KEYWORD2>Tan</KEYWORD2>
-
-			<KEYWORD2>Asc</KEYWORD2>
-			<KEYWORD2>Chr</KEYWORD2>
-			<KEYWORD2>CJustify</KEYWORD2>
-			<KEYWORD2>Compare</KEYWORD2>
-			<KEYWORD2>CompareNoCase</KEYWORD2>
-			<KEYWORD2>Find</KEYWORD2>
-			<KEYWORD2>FindNoCase</KEYWORD2>
-			<KEYWORD2>FindOneOf</KEYWORD2>
-			<KEYWORD2>GetToken</KEYWORD2>
-			<KEYWORD2>Insert</KEYWORD2>
-			<KEYWORD2>LCase</KEYWORD2>
-			<KEYWORD2>Left</KEYWORD2>
-			<KEYWORD2>Len</KEYWORD2>
-			<KEYWORD2>LJustify</KEYWORD2>
-			<KEYWORD2>LTrim</KEYWORD2>
-			<KEYWORD2>Mid</KEYWORD2>
+			<KEYWORD2>PrecisionEvaluate</KEYWORD2>
+			<KEYWORD2>PreserveSingleQuotes</KEYWORD2>
+			<KEYWORD2>Quarter</KEYWORD2>
+			<KEYWORD2>QueryAddColumn</KEYWORD2>
+			<KEYWORD2>QueryAddRow</KEYWORD2>
+			<KEYWORD2>QueryConvertForGrid</KEYWORD2>
+			<KEYWORD2>QueryNew</KEYWORD2>
+			<KEYWORD2>QuerySetCell</KEYWORD2>
+			<KEYWORD2>QuotedValueList</KEYWORD2>
 			<KEYWORD2>REFind</KEYWORD2>
 			<KEYWORD2>REFindNoCase</KEYWORD2>
+			<KEYWORD2>REMatch</KEYWORD2>
+			<KEYWORD2>REMatchNoCase</KEYWORD2>
+			<KEYWORD2>REReplace</KEYWORD2>
+			<KEYWORD2>REReplaceNoCase</KEYWORD2>
+			<KEYWORD2>RJustify</KEYWORD2>
+			<KEYWORD2>RTrim</KEYWORD2>
+			<KEYWORD2>Rand</KEYWORD2>
+			<KEYWORD2>RandRange</KEYWORD2>
+			<KEYWORD2>Randomize</KEYWORD2>
+			<KEYWORD2>ReleaseComObject</KEYWORD2>
 			<KEYWORD2>RemoveChars</KEYWORD2>
 			<KEYWORD2>RepeatString</KEYWORD2>
 			<KEYWORD2>Replace</KEYWORD2>
 			<KEYWORD2>ReplaceList</KEYWORD2>
 			<KEYWORD2>ReplaceNoCase</KEYWORD2>
-			<KEYWORD2>REReplace</KEYWORD2>
-			<KEYWORD2>REReplaceNoCase</KEYWORD2>
 			<KEYWORD2>Reverse</KEYWORD2>
 			<KEYWORD2>Right</KEYWORD2>
-			<KEYWORD2>RJustify</KEYWORD2>
-			<KEYWORD2>RTrim</KEYWORD2>
+			<KEYWORD2>Round</KEYWORD2>
+			<KEYWORD2>Second</KEYWORD2>
+			<KEYWORD2>SendGatewayMessage</KEYWORD2>
+			<KEYWORD2>SerializeJSON</KEYWORD2>
+			<KEYWORD2>SetLocale</KEYWORD2>
+			<KEYWORD2>SetProfileString</KEYWORD2>
+			<KEYWORD2>SetVariable</KEYWORD2>
+			<KEYWORD2>Sgn</KEYWORD2>
+			<KEYWORD2>Sin</KEYWORD2>
+			<KEYWORD2>Sleep</KEYWORD2>
 			<KEYWORD2>SpanExcluding</KEYWORD2>
 			<KEYWORD2>SpanIncluding</KEYWORD2>
+			<KEYWORD2>SpreadsheetAddColumn</KEYWORD2>
+			<KEYWORD2>SpreadsheetAddFreezePane</KEYWORD2>
+			<KEYWORD2>SpreadsheetAddImage</KEYWORD2>
+			<KEYWORD2>SpreadsheetAddInfo</KEYWORD2>
+			<KEYWORD2>SpreadsheetAddRow</KEYWORD2>
+			<KEYWORD2>SpreadsheetAddRows</KEYWORD2>
+			<KEYWORD2>SpreadsheetAddSplitPane</KEYWORD2>
+			<KEYWORD2>SpreadsheetCreateSheet</KEYWORD2>
+			<KEYWORD2>SpreadsheetDeleteColumn</KEYWORD2>
+			<KEYWORD2>SpreadsheetDeleteColumns</KEYWORD2>
+			<KEYWORD2>SpreadsheetDeleteRow</KEYWORD2>
+			<KEYWORD2>SpreadsheetDeleteRows</KEYWORD2>
+			<KEYWORD2>SpreadsheetFormatCell</KEYWORD2>
+			<KEYWORD2>SpreadsheetFormatCellRange</KEYWORD2>
+			<KEYWORD2>SpreadsheetFormatColumn</KEYWORD2>
+			<KEYWORD2>SpreadsheetFormatColumns</KEYWORD2>
+			<KEYWORD2>SpreadsheetFormatRow</KEYWORD2>
+			<KEYWORD2>SpreadsheetFormatRows</KEYWORD2>
+			<KEYWORD2>SpreadsheetGetCellComment</KEYWORD2>
+			<KEYWORD2>SpreadsheetGetCellFormula</KEYWORD2>
+			<KEYWORD2>SpreadsheetGetCellValue</KEYWORD2>
+			<KEYWORD2>SpreadsheetInfo</KEYWORD2>
+			<KEYWORD2>SpreadsheetMergeCells</KEYWORD2>
+			<KEYWORD2>SpreadsheetNew</KEYWORD2>
+			<KEYWORD2>SpreadsheetRead</KEYWORD2>
+			<KEYWORD2>SpreadsheetReadBinary</KEYWORD2>
+			<KEYWORD2>SpreadsheetRemoveSheet</KEYWORD2>
+			<KEYWORD2>SpreadsheetSetActiveSheet</KEYWORD2>
+			<KEYWORD2>SpreadsheetSetActiveSheetNumber</KEYWORD2>
+			<KEYWORD2>SpreadsheetSetCellComment</KEYWORD2>
+			<KEYWORD2>SpreadsheetSetCellFormula</KEYWORD2>
+			<KEYWORD2>SpreadsheetSetCellValue</KEYWORD2>
+			<KEYWORD2>SpreadsheetSetColumnWidth</KEYWORD2>
+			<KEYWORD2>SpreadsheetSetFooter</KEYWORD2>
+			<KEYWORD2>SpreadsheetSetHeader</KEYWORD2>
+			<KEYWORD2>SpreadsheetSetRowHeight</KEYWORD2>
+			<KEYWORD2>SpreadsheetShiftColumns</KEYWORD2>
+			<KEYWORD2>SpreadsheetShiftRows</KEYWORD2>
+			<KEYWORD2>SpreadsheetWrite</KEYWORD2>
+			<KEYWORD2>Sqr</KEYWORD2>
+			<KEYWORD2>StripCR</KEYWORD2>
+			<KEYWORD2>StructAppend</KEYWORD2>
+			<KEYWORD2>StructClear</KEYWORD2>
+			<KEYWORD2>StructCopy</KEYWORD2>
+			<KEYWORD2>StructCount</KEYWORD2>
+			<KEYWORD2>StructDelete</KEYWORD2>
+			<KEYWORD2>StructFind</KEYWORD2>
+			<KEYWORD2>StructFindKey</KEYWORD2>
+			<KEYWORD2>StructFindValue</KEYWORD2>
+			<KEYWORD2>StructGet</KEYWORD2>
+			<KEYWORD2>StructInsert</KEYWORD2>
+			<KEYWORD2>StructIsEmpty</KEYWORD2>
+			<KEYWORD2>StructKeyArray</KEYWORD2>
+			<KEYWORD2>StructKeyExists</KEYWORD2>
+			<KEYWORD2>StructKeyList</KEYWORD2>
+			<KEYWORD2>StructNew</KEYWORD2>
+			<KEYWORD2>StructSort</KEYWORD2>
+			<KEYWORD2>StructUpdate</KEYWORD2>
+			<KEYWORD2>Tan</KEYWORD2>
+			<KEYWORD2>Throw</KEYWORD2>
+			<KEYWORD2>TimeFormat</KEYWORD2>
+			<KEYWORD2>ToBase64</KEYWORD2>
+			<KEYWORD2>ToBinary</KEYWORD2>
+			<KEYWORD2>ToScript</KEYWORD2>
+			<KEYWORD2>ToString</KEYWORD2>
+			<KEYWORD2>Trace</KEYWORD2>
+			<KEYWORD2>TransactionCommit</KEYWORD2>
+			<KEYWORD2>TransactionRollback</KEYWORD2>
+			<KEYWORD2>TransactionSetSavePoint</KEYWORD2>
 			<KEYWORD2>Trim</KEYWORD2>
 			<KEYWORD2>UCase</KEYWORD2>
-			<KEYWORD2>Val</KEYWORD2>
-
-			<KEYWORD2>DirectoryExists</KEYWORD2>
-			<KEYWORD2>ExpandPath</KEYWORD2>
-			<KEYWORD2>FileExists</KEYWORD2>
-			<KEYWORD2>GetDirectoryFromPath</KEYWORD2>
-			<KEYWORD2>GetFileFromPath</KEYWORD2>
-			<KEYWORD2>GetTempDirectory</KEYWORD2>
-			<KEYWORD2>GetTempFile</KEYWORD2>
-			<KEYWORD2>GetTemplatePath</KEYWORD2>
-
-			<KEYWORD2>QueryAddRow</KEYWORD2>
-			<KEYWORD2>QueryNew</KEYWORD2>
-			<KEYWORD2>QuerySetCell</KEYWORD2>
-
-			<KEYWORD2>Decrypt</KEYWORD2>
-			<KEYWORD2>DeleteClientVariable</KEYWORD2>
-			<KEYWORD2>Encrypt</KEYWORD2>
-			<KEYWORD2>GetBaseTagData</KEYWORD2>
-			<KEYWORD2>GetBaseTagList</KEYWORD2>
-			<KEYWORD2>GetClientVariablesList</KEYWORD2>
-			<KEYWORD2>GetTickCount</KEYWORD2>
-			<KEYWORD2>PreserveSingleQuotes</KEYWORD2>
-			<KEYWORD2>QuotedValueList</KEYWORD2>
-			<KEYWORD2>StripCR</KEYWORD2>
+			<KEYWORD2>URLDecode</KEYWORD2>
 			<KEYWORD2>URLEncodedFormat</KEYWORD2>
+			<KEYWORD2>URLSessionFormat</KEYWORD2>
+			<KEYWORD2>Val</KEYWORD2>
 			<KEYWORD2>ValueList</KEYWORD2>
+			<KEYWORD2>VerifyClient</KEYWORD2>
+			<KEYWORD2>Week</KEYWORD2>
+			<KEYWORD2>Wrap</KEYWORD2>
+			<KEYWORD2>WriteDump</KEYWORD2>
+			<KEYWORD2>WriteLog</KEYWORD2>
 			<KEYWORD2>WriteOutput</KEYWORD2>
-
-			<KEYWORD2>ParameterExists</KEYWORD2>
+			<KEYWORD2>XmlChildPos</KEYWORD2>
+			<KEYWORD2>XmlElemNew</KEYWORD2>
+			<KEYWORD2>XmlFormat</KEYWORD2>
+			<KEYWORD2>XmlGetNodeType</KEYWORD2>
+			<KEYWORD2>XmlNew</KEYWORD2>
+			<KEYWORD2>XmlParse</KEYWORD2>
+			<KEYWORD2>XmlSearch</KEYWORD2>
+			<KEYWORD2>XmlTransform</KEYWORD2>
+			<KEYWORD2>XmlValidate</KEYWORD2>
+			<KEYWORD2>Year</KEYWORD2>
+			<KEYWORD2>YesNoFormat</KEYWORD2>
 
 			<OPERATOR>IS</OPERATOR>
 			<OPERATOR>EQ</OPERATOR>
@@ -642,4 +648,4 @@
 			<OPERATOR>XOR</OPERATOR>
 		</KEYWORDS>
 	</RULES>
-</MODE>
\ No newline at end of file
+</MODE>
diff --git a/modes/css.xml b/modes/css.xml
index 2b7e097..b202735 100644
--- a/modes/css.xml
+++ b/modes/css.xml
@@ -407,28 +407,35 @@
 		DIGIT_RE="-?\d+(\.\d+)?(pt|pc|in|mm|cm|em|ex|px|ms|s|%|)"
 		NO_WORD_SEP="-_%">
 
-		<SPAN TYPE="LITERAL1" ESCAPE="\">
-			<BEGIN>"</BEGIN>
-			<END>"</END>
-		</SPAN>
+		<SPAN_REGEXP TYPE="LITERAL1" ESCAPE="\" HASH_CHARS=""'">
+			<BEGIN>(["'])</BEGIN>
+			<END>$1</END>
+		</SPAN_REGEXP>
 
 		<!-- "functions" -->
-		<SPAN_REGEXP TYPE="LITERAL1" HASH_CHARS="RU" MATCH_TYPE="KEYWORD1">
-			<BEGIN>(rgb|url)\s*\(</BEGIN>
+
+		<!-- url without quotes -->
+		<SPAN_REGEXP TYPE="LITERAL1" MATCH_TYPE="KEYWORD1" HASH_CHAR="url(" ESCAPE="\">
+			<BEGIN>url\((?=\s*[^"'])</BEGIN>
 			<END>)</END>
 		</SPAN_REGEXP>
 
-		<!-- <SEQ DELEGATE="PROP_VALUE_COLOR">#</SEQ> -->
-		<MARK_FOLLOWING TYPE="DIGIT">#</MARK_FOLLOWING>
-
-		<SEQ_REGEXP HASH_CHAR="!" TYPE="KEYWORD2">!\s*important</SEQ_REGEXP>
-
 		<!-- proprietary IE function: -->
 		<SPAN_REGEXP TYPE="FUNCTION" DELEGATE="javascript::MAIN" HASH_CHAR="expression">
 			<BEGIN>expression\s*\(</BEGIN>
 			<END>)</END>
 		</SPAN_REGEXP>
 
+		<!-- all other functions -->
+		<SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="PROP_VALUE">
+			<BEGIN>[\w-]+\(</BEGIN>
+			<END>)</END>
+		</SPAN_REGEXP>
+
+		<MARK_FOLLOWING TYPE="DIGIT">#</MARK_FOLLOWING>
+
+		<SEQ_REGEXP HASH_CHAR="!" TYPE="KEYWORD2">!\s*important</SEQ_REGEXP>
+
 		<!-- Delegate back: -->
 		<SEQ TYPE="OPERATOR" DELEGATE="PROPERTIES">;</SEQ>
 		<SEQ TYPE="INVALID" DELEGATE="MAIN">}</SEQ> <!-- end properties block, but it's invalid -->
diff --git a/modes/html.xml b/modes/html.xml
index d871228..68c0f49 100644
--- a/modes/html.xml
+++ b/modes/html.xml
@@ -16,16 +16,12 @@
 		</SPAN>
 
 		<!-- JavaScript -->
-		<SPAN_REGEXP TYPE="MARKUP" HASH_CHAR="<" DELEGATE="JAVASCRIPT">
-			<BEGIN><(?i)(script)</BEGIN>
-			<END></$1></END>
-		</SPAN_REGEXP>
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="SCRIPT_TAG"
+					HASH_CHAR="<"><(?=SCRIPT\b)</SEQ_REGEXP>
 
 		<!-- stylesheet -->
-		<SPAN TYPE="MARKUP" DELEGATE="CSS">
-			<BEGIN><STYLE</BEGIN>
-			<END></STYLE></END>
-		</SPAN>
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="STYLE_TAG"
+					HASH_CHAR="<"><(?=STYLE\b)</SEQ_REGEXP>
 
 		<!-- DTD instructions -->
 		<SPAN TYPE="KEYWORD2" DELEGATE="xml::DTD-TAGS">
@@ -63,11 +59,11 @@
 		</SPAN_REGEXP>
 
 		<!-- NOTE: no ESCAPE for quotes, at least for attributes; e.g onclick="alert(\"foo\");" is invalid! -->
-		<SPAN TYPE="LITERAL1">
+		<SPAN TYPE="LITERAL1" DELEGATE="STRING">
 			<BEGIN>"</BEGIN>
 			<END>"</END>
 		</SPAN>
-		<SPAN TYPE="LITERAL1">
+		<SPAN TYPE="LITERAL1" DELEGATE="STRING">
 			<BEGIN>'</BEGIN>
 			<END>'</END>
 		</SPAN>
@@ -203,15 +199,153 @@
 		</KEYWORDS>
 	</RULES>
 
-	<RULES SET="JAVASCRIPT" DEFAULT="MARKUP" IGNORE_CASE="TRUE">
+	<!-- SCRIPT tag: Highlight tag and switch to language ruleset. -->
+	<RULES SET="SCRIPT_TAG" DEFAULT="MARKUP">
+		<!--If the content of the TYPE attribute is recognized, switch to
+			language specific ruleset. -->
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="COFFEESCRIPT_TAG"
+					HASH_CHAR="type">type(?=\s*=\s*['"]?text/coffeescript)</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="VBSCRIPT_TAG"
+					HASH_CHAR="type">type(?=\s*=\s*['"]?text/vbscript)</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="VBSCRIPT_TAG"
+					HASH_CHAR="language">language(?=\s*=\s*['"]?vbscript)</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="PYTHON_SCRIPT_TAG"
+					HASH_CHAR="type">type(?=\s*=\s*['"]?\w+/python)</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="RUBY_SCRIPT_TAG"
+					HASH_CHAR="type">type(?=\s*=\s*['"]?\w+/ruby)</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="XML_SCRIPT_TAG"
+					HASH_CHAR="type">type(?=\s*=\s*['"]?application/xml)</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="XQUERY_SCRIPT_TAG"
+					HASH_CHAR="type">type(?=\s*=\s*['"]?\w+/xquery)</SEQ_REGEXP>
+		<!-- Switch to JavaScript ruleset after the tag. -->
+		<SEQ TYPE="MARKUP" DELEGATE="JAVASCRIPT">></SEQ>
+		<!-- Import rules for highlighting. -->
+		<IMPORT DELEGATE="TAGS"/>
+	</RULES>
+
+	<!-- JavaScript (NOTE: RULES attributes must match the imported rules.)-->
+	<RULES SET="JAVASCRIPT" 
+		IGNORE_CASE="FALSE"
+		HIGHLIGHT_DIGITS="TRUE"
+		DIGIT_RE="(0x[\p{XDigit}]+[lL]?|[\p{Digit}]+(e[\p{Digit}]*)?[lLdDfF]?)">
+		<!-- "Override" comments to avoid consuming the </SCRIPT> tag. -->
+		<SPAN_REGEXP TYPE="COMMENT1" HASH_CHAR="/*">
+			<BEGIN>/\*</BEGIN>
+			<END REGEXP="TRUE">(?i)(?=</SCRIPT\b)</END>
+		</SPAN_REGEXP>
+		<SEQ_REGEXP TYPE="COMMENT2" HASH_CHAR="//">(?i)//.*(?=</SCRIPT\b)</SEQ_REGEXP>
+		<!-- If closing </SCRIPT> tag is found, switch to ENDTAG ruleset. -->
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
+					HASH_CHAR="<">(?i)<(?=/SCRIPT\b)</SEQ_REGEXP>
+		<!-- Import rules for JavaScript mode. -->
 		<IMPORT DELEGATE="javascript::MAIN"/>
 	</RULES>
 
-	<RULES SET="BACK_TO_HTML" DEFAULT="MARKUP">
-		<SEQ TYPE="MARKUP" DELEGATE="html::MAIN">></SEQ>
+	<!-- CoffeeScript -->
+	<RULES SET="COFFEESCRIPT_TAG" DEFAULT="MARKUP">
+		<SEQ TYPE="MARKUP" DELEGATE="COFFEESCRIPT">></SEQ>
+		<IMPORT DELEGATE="TAGS"/>
+	</RULES>
+	<RULES SET="COFFEESCRIPT"
+		IGNORE_CASE="FALSE"
+		HIGHLIGHT_DIGITS="TRUE"
+		NO_WORD_SEP="$_"
+		DIGIT_RE="(0b[01]+)|(0o[0-7]+)|(0x\p{XDigit}+)|(\d*\.?\d+(e[+-]?\d+)?)">
+		<SPAN_REGEXP TYPE="COMMENT2" HASH_CHAR="###">
+			<BEGIN>###(?!#)</BEGIN>
+			<END REGEXP="TRUE">(?i)(?=</SCRIPT\b)</END>
+		</SPAN_REGEXP>
+		<SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="#">(?i)#.*(?=</SCRIPT\b)</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
+					HASH_CHAR="<">(?i)<(?=/SCRIPT\b)</SEQ_REGEXP>
+		<IMPORT DELEGATE="coffeescript::MAIN"/>
+	</RULES>
+
+	<!-- Python - provided by Gestalt -->
+	<RULES SET="PYTHON_SCRIPT_TAG" DEFAULT="MARKUP">
+		<SEQ TYPE="MARKUP" DELEGATE="PYTHON">></SEQ>
+		<IMPORT DELEGATE="TAGS"/>
+	</RULES>
+	<RULES SET="PYTHON" IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="TRUE">
+		<SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="#">(?i)#.*(?=</SCRIPT\b)</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
+					HASH_CHAR="<">(?i)<(?=/SCRIPT\b)</SEQ_REGEXP>
+		<IMPORT DELEGATE="python::MAIN"/>
+	</RULES>
+
+	<!-- Ruby - provided by Gestalt -->
+	<RULES SET="RUBY_SCRIPT_TAG" DEFAULT="MARKUP">
+		<SEQ TYPE="MARKUP" DELEGATE="RUBY">></SEQ>
+		<IMPORT DELEGATE="TAGS"/>
+	</RULES>
+	<RULES SET="RUBY" IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="TRUE"
+		DIGIT_RE="(0b[01]([01_]*[01])?)|(0x[\p{XDigit}]([\p{XDigit}_]*[\p{XDigit}])?)|(0([0-7_]*[0-7])?)|(0d[0-9]([0-9_]*[0-9])?)|([1-9]([0-9_]*[0-9])?)|([0-9]([0-9_]*[0-9])?[Ee]([0-9]([0-9_]*[0-9])?)?)">
+		<SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="#">(?i)#.*(?=</SCRIPT\b)</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
+					HASH_CHAR="<">(?i)<(?=/SCRIPT\b)</SEQ_REGEXP>
+		<IMPORT DELEGATE="ruby::MAIN"/>
+	</RULES>
+
+	<!-- VBScript - provided by Internet Explorer -->
+	<RULES SET="VBSCRIPT_TAG" DEFAULT="MARKUP">
+		<SEQ TYPE="MARKUP" DELEGATE="VBSCRIPT">></SEQ>
+		<IMPORT DELEGATE="TAGS"/>
+	</RULES>
+	<RULES SET="VBSCRIPT" HIGHLIGHT_DIGITS="TRUE">
+		<SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="'">'.*(?=</SCRIPT\b)</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="rem">rem(\b.*)?(?=</SCRIPT\b)</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
+					HASH_CHAR="<"><(?=/SCRIPT\b)</SEQ_REGEXP>
+		<IMPORT DELEGATE="vbscript::MAIN"/>
+	</RULES>
+
+	<!-- XML - for XAML, provided by Gestalt -->
+	<RULES SET="XML_SCRIPT_TAG" DEFAULT="MARKUP">
+		<SEQ TYPE="MARKUP" DELEGATE="XML">></SEQ>
+		<IMPORT DELEGATE="TAGS"/>
+	</RULES>
+	<RULES SET="XML">
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
+					HASH_CHAR="<"><(?=/SCRIPT\b)</SEQ_REGEXP>
+		<IMPORT DELEGATE="xml::MAIN"/>
+	</RULES>
+
+	<!-- XQUERY - provided by XQIB -->
+	<RULES SET="XQUERY_SCRIPT_TAG" DEFAULT="MARKUP">
+		<SEQ TYPE="MARKUP" DELEGATE="XQUERY">></SEQ>
+		<IMPORT DELEGATE="TAGS"/>
+	</RULES>
+	<RULES SET="XQUERY">
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
+					HASH_CHAR="<"><(?=/SCRIPT\b)</SEQ_REGEXP>
+		<IMPORT DELEGATE="xq::MAIN"/>
+	</RULES>
+
+	<!-- STYLE tag: Highlight tag and delegate to CSS mode. -->
+	<RULES SET="STYLE_TAG" DEFAULT="MARKUP">
+		<SEQ TYPE="MARKUP" DELEGATE="CSS">></SEQ>
+		<IMPORT DELEGATE="TAGS"/>
+	</RULES>
+
+	<RULES SET="CSS"
+	    HIGHLIGHT_DIGITS="TRUE"
+		DIGIT_RE="-?\d+(\.\d+)?(pt|pc|in|mm|cm|em|ex|px|ms|s|%|)"
+		NO_WORD_SEP="-_%">
+		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
+					HASH_CHAR="<"><(?=/STYLE\b)</SEQ_REGEXP>
+		<IMPORT DELEGATE="css::MAIN"/>
 	</RULES>
 
-	<RULES SET="CSS" DEFAULT="MARKUP">
-		<SEQ TYPE="MARKUP" DELEGATE="css::MAIN">></SEQ>
+	<!-- Closing tag: Highlight tag and return to MAIN ruleset. -->
+	<RULES SET="ENDTAG" DEFAULT="MARKUP">
+		<SEQ TYPE="MARKUP" DELEGATE="MAIN">></SEQ>
+		<IMPORT DELEGATE="TAGS"/>
 	</RULES>
+	
+ 	<RULES SET="STRING" DEFAULT="LITERAL1">
+ 		<SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
+ 			<BEGIN>&</BEGIN>
+ 			<END>;</END>
+ 		</SPAN>
+ 	</RULES>	
 </MODE>
diff --git a/modes/jamon.xml b/modes/jamon.xml
new file mode 100644
index 0000000..6dd29ff
--- /dev/null
+++ b/modes/jamon.xml
@@ -0,0 +1,123 @@
+<?xml version="1.0"?>
+<!DOCTYPE MODE SYSTEM "xmode.dtd">
+
+<!-- Mode file for Jamon templates. See http://www.jamon.org -->
+<MODE>
+	<PROPS>
+		<PROPERTY NAME="commentStart" VALUE="<%--" />
+		<PROPERTY NAME="commentEnd" VALUE="--%>" />
+	</PROPS>
+	<RULES DEFAULT="LITERAL2">
+		<IMPORT DELEGATE="INLINE" />
+		<IMPORT DELEGATE="OVERRIDES" />
+		<IMPORT DELEGATE="html::MAIN"/>
+	</RULES>
+
+	<RULES SET="INLINE" DEFAULT="LITERAL2">
+		<SPAN_REGEXP HASH_CHAR="<" MATCH_TYPE="OPERATOR" DELEGATE="java::MAIN">
+			<BEGIN><%(args|class|import|java|xargs)></BEGIN>
+			<END></%$1></END>
+		</SPAN_REGEXP>
+		<SPAN_REGEXP HASH_CHAR="<" MATCH_TYPE="OPERATOR" DELEGATE="java::MAIN">
+			<BEGIN><%(?:if|for|java)</BEGIN>
+			<END>%></END>
+		</SPAN_REGEXP>
+		<SEQ_REGEXP HASH_CHAR="<" TYPE="OPERATOR"></%(?:if|for)></SEQ_REGEXP>
+		<SEQ TYPE="OPERATOR"><%else></SEQ>
+
+		<SPAN_REGEXP HASH_CHAR="<" MATCH_TYPE="OPERATOR" TYPE="KEYWORD2">
+			<BEGIN><%(?:abstract|def|doc|escape|extends|frag|method|override)</BEGIN>
+			<END>></END>
+		</SPAN_REGEXP>
+		<SPAN_REGEXP HASH_CHAR="<" MATCH_TYPE="OPERATOR">
+			<BEGIN></%(?:def|doc|frag|method|override)</BEGIN>
+			<END>></END>
+		</SPAN_REGEXP>
+
+		<SPAN TYPE="OPERATOR" DELEGATE="java::MAIN">
+			<BEGIN><%</BEGIN>
+			<END>%></END>
+		</SPAN>
+
+		<SPAN_REGEXP HASH_CHAR="<" MATCH_TYPE="OPERATOR" DELEGATE="java::MAIN">
+			<BEGIN><&\|?</BEGIN>
+			<END>&></END>
+		</SPAN_REGEXP>
+		<SEQ TYPE="OPERATOR"></&></SEQ>
+	</RULES>
+
+	<RULES SET="OVERRIDES" IGNORE_CASE="TRUE" DEFAULT="LITERAL2">
+		<!-- CSS -->
+		<SPAN TYPE="MARKUP" DELEGATE="CSS">
+			<BEGIN><style</BEGIN>
+			<END></style></END>
+		</SPAN>
+
+		<!-- JavaScript -->
+		<SPAN_REGEXP TYPE="MARKUP" HASH_CHAR="<" DELEGATE="JAVASCRIPT">
+			<BEGIN><(?i)(script)</BEGIN>
+			<END></$1></END>
+		</SPAN_REGEXP>
+
+		<!-- HTML tags. -->
+		<SPAN TYPE="MARKUP" DELEGATE="TAGS">
+			<BEGIN><</BEGIN>
+			<END>></END>
+		</SPAN>
+	</RULES>
+
+	<RULES SET="JAVASCRIPT" DEFAULT="LITERAL1">
+		<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\" DELEGATE="INLINE">
+			<BEGIN>"</BEGIN>
+			<END>"</END>
+		</SPAN>
+		<IMPORT DELEGATE="INLINE" />
+		<IMPORT DELEGATE="javascript::MAIN" />
+	</RULES>
+
+	<RULES SET="CSS" DEFAULT="LITERAL1">
+		<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\" DELEGATE="INLINE">
+			<BEGIN>"</BEGIN>
+			<END>"</END>
+		</SPAN>
+		<IMPORT DELEGATE="INLINE" />
+		<IMPORT DELEGATE="css::MAIN" />
+	</RULES>
+
+	<!--
+	  This is a copy of above; IMPORT doesn't inherit DEFAULT and we need
+	  a different default depending on context.
+	-->
+	<RULES SET="INLINE_MARKUP" DEFAULT="LITERAL1">
+		<SPAN_REGEXP HASH_CHAR="<" MATCH_TYPE="OPERATOR" TYPE="KEYWORD2">
+			<BEGIN><%(?:abstract|def|doc|escape|extends|frag|method|override)</BEGIN>
+			<END>></END>
+		</SPAN_REGEXP>
+		<SPAN_REGEXP HASH_CHAR="<" MATCH_TYPE="OPERATOR">
+			<BEGIN></%(?:def|doc|frag|method|override)</BEGIN>
+			<END>></END>
+		</SPAN_REGEXP>
+
+		<SPAN TYPE="OPERATOR" DELEGATE="java::MAIN">
+			<BEGIN><%</BEGIN>
+			<END>%></END>
+		</SPAN>
+
+		<SPAN_REGEXP HASH_CHAR="<" MATCH_TYPE="OPERATOR" DELEGATE="java::MAIN">
+			<BEGIN><&\|?</BEGIN>
+			<END>&></END>
+		</SPAN_REGEXP>
+		<SEQ TYPE="OPERATOR"></&></SEQ>
+	</RULES>
+
+	<RULES SET="TAGS" DEFAULT="MARKUP">
+		<SPAN TYPE="LITERAL1" DELEGATE="INLINE_MARKUP">
+			<BEGIN>"</BEGIN>
+			<END>"</END>
+		</SPAN>
+		<IMPORT DELEGATE="INLINE_MARKUP" />
+		<IMPORT DELEGATE="html::TAGS" />
+	</RULES>
+
+</MODE>
+
diff --git a/modes/lua.xml b/modes/lua.xml
index b473b98..1f9bef9 100644
--- a/modes/lua.xml
+++ b/modes/lua.xml
@@ -28,27 +28,27 @@
   <RULES IGNORE_CASE="FALSE" NO_WORD_SEP="_:." HIGHLIGHT_DIGITS="TRUE"
          DIGIT_RE="[\p{Digit}]*(\.[\p{Digit}]*)?([eE][+-]?[\p{Digit}]*)?">
     <!-- Multiline comments -->
-    <SPAN TYPE="COMMENT1">
-      <BEGIN>--[[</BEGIN>
-      <END>]]</END>
-    </SPAN>
+    <SPAN_REGEXP TYPE="COMMENT1" HASH_CHARS="--[">
+      <BEGIN>--\[(=*)\[</BEGIN>
+      <END>]$1]</END>
+    </SPAN_REGEXP>
     <!-- Single line comments -->
     <EOL_SPAN TYPE="COMMENT1">--</EOL_SPAN>
     <EOL_SPAN AT_LINE_START="TRUE" TYPE="COMMENT2">#!</EOL_SPAN>
     <!-- Simple string literals -->
-    <SPAN TYPE="LITERAL1">
+    <SPAN TYPE="LITERAL1" ESCAPE="\">
       <BEGIN>"</BEGIN>
       <END>"</END>
     </SPAN>
-    <SPAN TYPE="LITERAL1">
+    <SPAN TYPE="LITERAL1" ESCAPE="\">
       <BEGIN>'</BEGIN>
       <END>'</END>
     </SPAN>
     <!-- Multiline string literals -->
-    <SPAN TYPE="LITERAL1">
-      <BEGIN>[[</BEGIN>
-      <END>]]</END>
-    </SPAN>
+    <SPAN_REGEXP TYPE="LITERAL1" HASH_CHAR="[">
+      <BEGIN>\[(=*)\[</BEGIN>
+      <END>]$1]</END>
+    </SPAN_REGEXP>
     <!-- Operators -->
     <SEQ TYPE="OPERATOR">+</SEQ>
     <SEQ TYPE="OPERATOR">-</SEQ>
diff --git a/modes/mail.xml b/modes/mail.xml
index e4766c5..5e9d521 100644
--- a/modes/mail.xml
+++ b/modes/mail.xml
@@ -26,10 +26,4 @@
 		<MARK_PREVIOUS AT_LINE_START="TRUE" TYPE="LABEL">:</MARK_PREVIOUS>
 	</RULES>
 	<RULES SET="SIGNATURE" DEFAULT="COMMENT2"/>
-	<RULES SET="HEADER" DEFAULT="MARKUP">
-		<SPAN NO_LINE_BREAK="TRUE" TYPE="KEYWORD2">
-			<BEGIN><</BEGIN>
-			<END>></END>
-		</SPAN>
-	</RULES>
 </MODE>
diff --git a/modes/maven.xml b/modes/maven.xml
index 7400387..d82f73f 100644
--- a/modes/maven.xml
+++ b/modes/maven.xml
@@ -1,372 +1,367 @@
-<?xml version="1.0"?>
-<!DOCTYPE MODE SYSTEM "xmode.dtd"><!-- mode for tag library description (maven) files -->
-<MODE>
-    <PROPS>
-        <PROPERTY NAME="commentStart" VALUE="<!--" />
-        <PROPERTY NAME="commentEnd" VALUE="-->" />
-    </PROPS>
-	<!-- {{{ MAIN -->
-    <RULES>
-		<!-- SGML comment -->
-        <SPAN TYPE="COMMENT1">
-            <BEGIN><!--</BEGIN>
-            <END>--></END>
-        </SPAN>
-
-		<!-- variables -->
-        <SPAN TYPE="KEYWORD4">
-            <BEGIN>${</BEGIN>
-            <END>}</END>
-        </SPAN>
-	
-		<!-- DTD Entity declarations -->
-        <SPAN TYPE="KEYWORD2" DELEGATE="ENTITY-TAGS">
-            <BEGIN><!ENTITY</BEGIN>
-            <END>></END>
-        </SPAN>
-
-		<!-- CDATA sections -->
-        <SPAN TYPE="KEYWORD2" DELEGATE="CDATA">
-            <BEGIN><![CDATA[</BEGIN>
-            <END>]]></END>
-        </SPAN>
-
-		<!-- DTD instructions -->
-        <SPAN TYPE="KEYWORD2" DELEGATE="DTD-TAGS">
-            <BEGIN><!</BEGIN>
-            <END>></END>
-        </SPAN>
-
-		<!-- PI directives -->
-        <SPAN TYPE="KEYWORD3">
-            <BEGIN><?</BEGIN>
-            <END>></END>
-        </SPAN>
-
-		<!-- markup tags -->
-        <SPAN TYPE="MARKUP" DELEGATE="TAGS">
-            <BEGIN><</BEGIN>
-            <END>></END>
-        </SPAN>
-
-		<!-- SGML entities -->
-        <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
-            <BEGIN>&</BEGIN>
-            <END>;</END>
-        </SPAN>
-
-        <KEYWORDS>
-            <KEYWORD4>true</KEYWORD4>
-            <KEYWORD4>false</KEYWORD4>
-            <KEYWORD4>default</KEYWORD4>
-        </KEYWORDS>
-
-    </RULES>
-	<!-- }}} -->
-	
-	<!-- {{{ TAGS -->
-    <RULES SET="TAGS" DEFAULT="MARKUP" NO_WORD_SEP="-_">
-		<!-- SGML comment -->
-        <SPAN TYPE="COMMENT1">
-            <BEGIN><!--</BEGIN>
-            <END>--></END>
-        </SPAN>
-
-        <SPAN TYPE="LITERAL1">
-            <BEGIN>"</BEGIN>
-            <END>"</END>
-        </SPAN>
-
-        <SPAN TYPE="LITERAL1">
-            <BEGIN>'</BEGIN>
-            <END>'</END>
-        </SPAN>
-
-        <SEQ TYPE="MARKUP" DELEGATE="STRING">"</SEQ>
-
-		<!-- variables -->
-        <SPAN TYPE="KEYWORD4">
-            <BEGIN>${</BEGIN>
-            <END>}</END>
-        </SPAN>
-    
-        <SEQ TYPE="MARKUP" DELEGATE="maven::MAIN">/></SEQ>
-        <MARK_PREVIOUS TYPE="LABEL">:</MARK_PREVIOUS>
-        <SEQ TYPE="OPERATOR">:</SEQ>
-        <KEYWORDS>
-            <KEYWORD1>project</KEYWORD1>
-
-            <KEYWORD2>basedir</KEYWORD2>
-            <KEYWORD2>project.baseUri</KEYWORD2>
-            <KEYWORD2>maven.build.timestamp</KEYWORD2>
-            <KEYWORD2>maven.build.timestamp.format</KEYWORD2>
-        
-        
-            <KEYWORD2>activation</KEYWORD2>
-            <KEYWORD2>activeByDefault</KEYWORD2>
-            <KEYWORD2>address</KEYWORD2>
-            <KEYWORD2>arch</KEYWORD2>
-            <KEYWORD2>archive</KEYWORD2>
-            <KEYWORD2>artifactId</KEYWORD2>
-            <KEYWORD2>build</KEYWORD2>
-            <KEYWORD2>checksumPolicy</KEYWORD2>
-            <KEYWORD2>ciManagement</KEYWORD2>
-            <KEYWORD2>classifier</KEYWORD2>
-            <KEYWORD2>comments</KEYWORD2>
-            <KEYWORD2>configuration</KEYWORD2>
-            <KEYWORD2>connection</KEYWORD2>
-            <KEYWORD2>contributors</KEYWORD2>
-            <KEYWORD2>defaultGoal</KEYWORD2>
-            <KEYWORD2>dependencies</KEYWORD2>
-            <KEYWORD2>dependencyManagement</KEYWORD2>
-            <KEYWORD2>description</KEYWORD2>
-            <KEYWORD2>developerConnection</KEYWORD2>
-            <KEYWORD2>developers</KEYWORD2>
-            <KEYWORD2>directory</KEYWORD2>
-            <KEYWORD2>distribution</KEYWORD2>
-            <KEYWORD2>distributionManagement</KEYWORD2>
-            <KEYWORD2>downloadUrl</KEYWORD2>
-            <KEYWORD2>email</KEYWORD2>
-            <KEYWORD2>enabled</KEYWORD2>
-            <KEYWORD2>excludeDefaults</KEYWORD2>
-            <KEYWORD2>excludes</KEYWORD2>
-            <KEYWORD2>exclusions</KEYWORD2>
-            <KEYWORD2>executions</KEYWORD2>
-            <KEYWORD2>exists</KEYWORD2>
-            <KEYWORD2>extensions</KEYWORD2>
-            <KEYWORD2>family</KEYWORD2>
-            <KEYWORD2>file</KEYWORD2>
-            <KEYWORD2>filtering</KEYWORD2>
-            <KEYWORD2>filters</KEYWORD2>
-            <KEYWORD2>finalName</KEYWORD2>
-            <KEYWORD2>goals</KEYWORD2>
-            <KEYWORD2>groupId</KEYWORD2>
-            <KEYWORD2>id</KEYWORD2>
-            <KEYWORD2>inceptionYear</KEYWORD2>
-            <KEYWORD2>includes</KEYWORD2>
-            <KEYWORD2>inherited</KEYWORD2>
-            <KEYWORD2>issueManagement</KEYWORD2>
-            <KEYWORD2>jdk</KEYWORD2>
-            <KEYWORD2>layout</KEYWORD2>
-            <KEYWORD2>licenses</KEYWORD2>
-            <KEYWORD2>mailingLists</KEYWORD2>
-            <KEYWORD2>maven</KEYWORD2>
-            <KEYWORD2>message</KEYWORD2>
-            <KEYWORD2>missing</KEYWORD2>
-            <KEYWORD2>modelVersion</KEYWORD2>
-            <KEYWORD2>modules</KEYWORD2>
-            <KEYWORD2>name</KEYWORD2>
-            <KEYWORD2>notifiers</KEYWORD2>
-            <KEYWORD2>optional</KEYWORD2>
-            <KEYWORD2>organization</KEYWORD2>
-            <KEYWORD2>organizationUrl</KEYWORD2>
-            <KEYWORD2>os</KEYWORD2>
-            <KEYWORD2>otherArchives</KEYWORD2>
-            <KEYWORD2>outputDirectory</KEYWORD2>
-            <KEYWORD2>packaging</KEYWORD2>
-            <KEYWORD2>parent</KEYWORD2>
-            <KEYWORD2>phase</KEYWORD2>
-            <KEYWORD2>pluginManagement</KEYWORD2>
-            <KEYWORD2>pluginRepositories</KEYWORD2>
-            <KEYWORD2>plugins</KEYWORD2>
-            <KEYWORD2>post</KEYWORD2>
-            <KEYWORD2>prerequisites</KEYWORD2>
-            <KEYWORD2>profiles</KEYWORD2>
-            <KEYWORD2>properties</KEYWORD2>
-            <KEYWORD2>property</KEYWORD2>
-            <KEYWORD2>relativePath</KEYWORD2>
-            <KEYWORD2>releases</KEYWORD2>
-            <KEYWORD2>relocation</KEYWORD2>
-            <KEYWORD2>reportSets</KEYWORD2>
-            <KEYWORD2>reporting</KEYWORD2>
-            <KEYWORD2>reports</KEYWORD2>
-            <KEYWORD2>repositories</KEYWORD2>
-            <KEYWORD2>repository</KEYWORD2>
-            <KEYWORD2>resources</KEYWORD2>
-            <KEYWORD2>roles</KEYWORD2>
-            <KEYWORD2>scm</KEYWORD2>
-            <KEYWORD2>scope</KEYWORD2>
-            <KEYWORD2>scriptSourceDirectory</KEYWORD2>
-            <KEYWORD2>sendOnError</KEYWORD2>
-            <KEYWORD2>sendOnFailure</KEYWORD2>
-            <KEYWORD2>sendOnSuccess</KEYWORD2>
-            <KEYWORD2>sendOnWarning</KEYWORD2>
-            <KEYWORD2>site</KEYWORD2>
-            <KEYWORD2>snapshotRepository</KEYWORD2>
-            <KEYWORD2>snapshots</KEYWORD2>
-            <KEYWORD2>sourceDirectory</KEYWORD2>
-            <KEYWORD2>status</KEYWORD2>
-            <KEYWORD2>subscribe</KEYWORD2>
-            <KEYWORD2>system</KEYWORD2>
-            <KEYWORD2>systemPath</KEYWORD2>
-            <KEYWORD2>tag</KEYWORD2>
-            <KEYWORD2>targetPath</KEYWORD2>
-            <KEYWORD2>testOutputDirectory</KEYWORD2>
-            <KEYWORD2>testResources</KEYWORD2>
-            <KEYWORD2>testSourceDirectory</KEYWORD2>
-            <KEYWORD2>timezone</KEYWORD2>
-            <KEYWORD2>type</KEYWORD2>
-            <KEYWORD2>uniqueVersion</KEYWORD2>
-            <KEYWORD2>unsubscribe</KEYWORD2>
-            <KEYWORD2>updatePolicy</KEYWORD2>
-            <KEYWORD2>url</KEYWORD2>
-            <KEYWORD2>value</KEYWORD2>
-            <KEYWORD2>version</KEYWORD2>
-
-            <KEYWORD3>contributor</KEYWORD3>
-            <KEYWORD3>dependency</KEYWORD3>
-            <KEYWORD3>developer</KEYWORD3>
-            <KEYWORD3>exclude</KEYWORD3>
-            <KEYWORD3>exclusion</KEYWORD3>
-            <KEYWORD3>execution</KEYWORD3>
-            <KEYWORD3>extension</KEYWORD3>
-            <KEYWORD3>filter</KEYWORD3>
-            <KEYWORD3>goal</KEYWORD3>
-            <KEYWORD3>include</KEYWORD3>
-            <KEYWORD3>license</KEYWORD3>
-            <KEYWORD3>mailingList</KEYWORD3>
-            <KEYWORD3>module</KEYWORD3>
-            <KEYWORD3>notifier</KEYWORD3>
-            <KEYWORD3>otherArchive</KEYWORD3>
-            <KEYWORD3>plugin</KEYWORD3>
-            <KEYWORD3>pluginRepository</KEYWORD3>
-            <KEYWORD3>profile</KEYWORD3>
-            <KEYWORD3>report</KEYWORD3>
-            <KEYWORD3>reportSet</KEYWORD3>
-            <KEYWORD3>repository</KEYWORD3>
-            <KEYWORD3>resource</KEYWORD3>
-            <KEYWORD3>role</KEYWORD3>
-            <KEYWORD3>testResource</KEYWORD3>
-        </KEYWORDS>
-    </RULES>
-	<!-- }}} -->
-	
-	<!-- {{{ DTD-TAGS -->
-    <RULES SET="DTD-TAGS" DEFAULT="KEYWORD2" IGNORE_CASE="FALSE">
-		<!-- SGML comment -->
-        <SPAN TYPE="COMMENT1">
-            <BEGIN><!--</BEGIN>
-            <END>--></END>
-        </SPAN>
-
-		<!-- SGML comment -->
-        <SPAN TYPE="COMMENT1">
-            <BEGIN>--</BEGIN>
-            <END>--</END>
-        </SPAN>
-
-		<!-- Parameter entities -->
-        <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
-            <BEGIN>%</BEGIN>
-            <END>;</END>
-        </SPAN>
-
-        <SPAN TYPE="LITERAL1">
-            <BEGIN>"</BEGIN>
-            <END>"</END>
-        </SPAN>
-
-        <SPAN TYPE="LITERAL1">
-            <BEGIN>'</BEGIN>
-            <END>'</END>
-        </SPAN>
-
-		<!-- This appears in some SGML documents -->
-        <SPAN TYPE="KEYWORD2" DELEGATE="MAIN">
-            <BEGIN>[</BEGIN>
-            <END>]</END>
-        </SPAN>
-
-        <SEQ TYPE="OPERATOR">(</SEQ>
-        <SEQ TYPE="OPERATOR">)</SEQ>
-        <SEQ TYPE="OPERATOR">|</SEQ>
-        <SEQ TYPE="OPERATOR">?</SEQ>
-        <SEQ TYPE="OPERATOR">*</SEQ>
-        <SEQ TYPE="OPERATOR">+</SEQ>
-        <SEQ TYPE="OPERATOR">,</SEQ>
-
-        <KEYWORDS>
-            <KEYWORD1>CDATA</KEYWORD1>
-            <KEYWORD1>EMPTY</KEYWORD1>
-            <KEYWORD1>INCLUDE</KEYWORD1>
-            <KEYWORD1>IGNORE</KEYWORD1>
-            <KEYWORD1>NDATA</KEYWORD1>
-            <KEYWORD1>#IMPLIED</KEYWORD1>
-            <KEYWORD1>#PCDATA</KEYWORD1>
-            <KEYWORD1>#REQUIRED</KEYWORD1>
-        </KEYWORDS>
-    </RULES>
-	<!-- }}} -->
-	
-	<!-- {{{ ENTITY-TAGS -->
-    <RULES SET="ENTITY-TAGS" DEFAULT="KEYWORD2">
-		<!-- SGML comment -->
-        <SPAN TYPE="COMMENT1">
-            <BEGIN><!--</BEGIN>
-            <END>--></END>
-        </SPAN>
-
-		<!-- SGML comment -->
-        <SPAN TYPE="COMMENT1">
-            <BEGIN>--</BEGIN>
-            <END>--</END>
-        </SPAN>
-
-        <SPAN TYPE="LITERAL1">
-            <BEGIN>"</BEGIN>
-            <END>"</END>
-        </SPAN>
-
-        <SPAN TYPE="LITERAL1">
-            <BEGIN>'</BEGIN>
-            <END>'</END>
-        </SPAN>
-
-        <SEQ TYPE="OPERATOR">=</SEQ>
-
-        <SEQ TYPE="OPERATOR">%</SEQ>
-
-        <KEYWORDS>
-            <KEYWORD1>SYSTEM</KEYWORD1>
-        </KEYWORDS>
-    </RULES>
-	<!-- }}} -->
-	
-	<!-- {{{ CDATA -->
-    <RULES SET="CDATA" DEFAULT="COMMENT2">
-        <KEYWORDS>
-            <LITERAL2>true</LITERAL2>
-            <LITERAL2>yes</LITERAL2>
-            <LITERAL2>false</LITERAL2>
-        </KEYWORDS>
-    </RULES>
-	<!-- }}} -->
-	
-	<!-- {{{ STRING -->
-    <RULES SET="STRING" DEFAULT="LITERAL1">
-		<!-- variables -->
-        <SPAN TYPE="KEYWORD4">
-            <BEGIN>${</BEGIN>
-            <END>}</END>
-        </SPAN>
-        <SEQ TYPE="NULL">\"</SEQ>
-        <SEQ TYPE="MARKUP" DELEGATE="TAGS">"</SEQ>
-
-        <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
-            <BEGIN>&</BEGIN>
-            <END>;</END>
-        </SPAN>
-        <KEYWORDS>
-            <LITERAL2>true</LITERAL2>
-            <LITERAL2>yes</LITERAL2>
-            <LITERAL2>false</LITERAL2>
-        </KEYWORDS>
-    </RULES>
-	<!-- }}} -->
-
-    <RULES SET="BACK_TO_XML" DEFAULT="MARKUP">
-        <SEQ TYPE="MARKUP" DELEGATE="maven::TAGS">></SEQ>
-    </RULES>
-</MODE>
+<?xml version="1.0"?>
+<!DOCTYPE MODE SYSTEM "xmode.dtd"><!-- mode for tag library description (maven) files -->
+<MODE>
+    <PROPS>
+        <PROPERTY NAME="commentStart" VALUE="<!--" />
+        <PROPERTY NAME="commentEnd" VALUE="-->" />
+    </PROPS>
+	<!-- {{{ MAIN -->
+    <RULES>
+		<!-- SGML comment -->
+        <SPAN TYPE="COMMENT1">
+            <BEGIN><!--</BEGIN>
+            <END>--></END>
+        </SPAN>
+
+		<!-- variables -->
+        <SPAN TYPE="KEYWORD4">
+            <BEGIN>${</BEGIN>
+            <END>}</END>
+        </SPAN>
+	
+		<!-- DTD Entity declarations -->
+        <SPAN TYPE="KEYWORD2" DELEGATE="ENTITY-TAGS">
+            <BEGIN><!ENTITY</BEGIN>
+            <END>></END>
+        </SPAN>
+
+		<!-- CDATA sections -->
+        <SPAN TYPE="KEYWORD2" DELEGATE="CDATA">
+            <BEGIN><![CDATA[</BEGIN>
+            <END>]]></END>
+        </SPAN>
+
+		<!-- DTD instructions -->
+        <SPAN TYPE="KEYWORD2" DELEGATE="DTD-TAGS">
+            <BEGIN><!</BEGIN>
+            <END>></END>
+        </SPAN>
+
+		<!-- PI directives -->
+        <SPAN TYPE="KEYWORD3">
+            <BEGIN><?</BEGIN>
+            <END>></END>
+        </SPAN>
+
+		<!-- markup tags -->
+        <SPAN TYPE="MARKUP" DELEGATE="TAGS">
+            <BEGIN><</BEGIN>
+            <END>></END>
+        </SPAN>
+
+		<!-- SGML entities -->
+        <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
+            <BEGIN>&</BEGIN>
+            <END>;</END>
+        </SPAN>
+
+        <KEYWORDS>
+            <KEYWORD4>true</KEYWORD4>
+            <KEYWORD4>false</KEYWORD4>
+            <KEYWORD4>default</KEYWORD4>
+        </KEYWORDS>
+
+    </RULES>
+	<!-- }}} -->
+	
+	<!-- {{{ TAGS -->
+    <RULES SET="TAGS" DEFAULT="MARKUP" NO_WORD_SEP="-_">
+		<!-- SGML comment -->
+        <SPAN TYPE="COMMENT1">
+            <BEGIN><!--</BEGIN>
+            <END>--></END>
+        </SPAN>
+
+        <SPAN TYPE="LITERAL1" DELEGATE="STRING">
+            <BEGIN>"</BEGIN>
+            <END>"</END>
+        </SPAN>
+     
+        <SPAN TYPE="LITERAL1" DELEGATE="STRING">
+            <BEGIN>'</BEGIN>
+            <END>'</END>
+        </SPAN>
+
+		<!-- variables -->
+        <SPAN TYPE="KEYWORD4">
+            <BEGIN>${</BEGIN>
+            <END>}</END>
+        </SPAN>
+    
+        <SEQ TYPE="MARKUP" DELEGATE="maven::MAIN">/></SEQ>
+        <MARK_PREVIOUS TYPE="LABEL">:</MARK_PREVIOUS>
+        <SEQ TYPE="OPERATOR">:</SEQ>
+        <KEYWORDS>
+            <KEYWORD1>project</KEYWORD1>
+
+            <KEYWORD2>basedir</KEYWORD2>
+            <KEYWORD2>project.baseUri</KEYWORD2>
+            <KEYWORD2>maven.build.timestamp</KEYWORD2>
+            <KEYWORD2>maven.build.timestamp.format</KEYWORD2>
+        
+        
+            <KEYWORD2>activation</KEYWORD2>
+            <KEYWORD2>activeByDefault</KEYWORD2>
+            <KEYWORD2>address</KEYWORD2>
+            <KEYWORD2>arch</KEYWORD2>
+            <KEYWORD2>archive</KEYWORD2>
+            <KEYWORD2>artifactId</KEYWORD2>
+            <KEYWORD2>build</KEYWORD2>
+            <KEYWORD2>checksumPolicy</KEYWORD2>
+            <KEYWORD2>ciManagement</KEYWORD2>
+            <KEYWORD2>classifier</KEYWORD2>
+            <KEYWORD2>comments</KEYWORD2>
+            <KEYWORD2>configuration</KEYWORD2>
+            <KEYWORD2>connection</KEYWORD2>
+            <KEYWORD2>contributors</KEYWORD2>
+            <KEYWORD2>defaultGoal</KEYWORD2>
+            <KEYWORD2>dependencies</KEYWORD2>
+            <KEYWORD2>dependencyManagement</KEYWORD2>
+            <KEYWORD2>description</KEYWORD2>
+            <KEYWORD2>developerConnection</KEYWORD2>
+            <KEYWORD2>developers</KEYWORD2>
+            <KEYWORD2>directory</KEYWORD2>
+            <KEYWORD2>distribution</KEYWORD2>
+            <KEYWORD2>distributionManagement</KEYWORD2>
+            <KEYWORD2>downloadUrl</KEYWORD2>
+            <KEYWORD2>email</KEYWORD2>
+            <KEYWORD2>enabled</KEYWORD2>
+            <KEYWORD2>excludeDefaults</KEYWORD2>
+            <KEYWORD2>excludes</KEYWORD2>
+            <KEYWORD2>exclusions</KEYWORD2>
+            <KEYWORD2>executions</KEYWORD2>
+            <KEYWORD2>exists</KEYWORD2>
+            <KEYWORD2>extensions</KEYWORD2>
+            <KEYWORD2>family</KEYWORD2>
+            <KEYWORD2>file</KEYWORD2>
+            <KEYWORD2>filtering</KEYWORD2>
+            <KEYWORD2>filters</KEYWORD2>
+            <KEYWORD2>finalName</KEYWORD2>
+            <KEYWORD2>goals</KEYWORD2>
+            <KEYWORD2>groupId</KEYWORD2>
+            <KEYWORD2>id</KEYWORD2>
+            <KEYWORD2>inceptionYear</KEYWORD2>
+            <KEYWORD2>includes</KEYWORD2>
+            <KEYWORD2>inherited</KEYWORD2>
+            <KEYWORD2>issueManagement</KEYWORD2>
+            <KEYWORD2>jdk</KEYWORD2>
+            <KEYWORD2>layout</KEYWORD2>
+            <KEYWORD2>licenses</KEYWORD2>
+            <KEYWORD2>mailingLists</KEYWORD2>
+            <KEYWORD2>maven</KEYWORD2>
+            <KEYWORD2>message</KEYWORD2>
+            <KEYWORD2>missing</KEYWORD2>
+            <KEYWORD2>modelVersion</KEYWORD2>
+            <KEYWORD2>modules</KEYWORD2>
+            <KEYWORD2>name</KEYWORD2>
+            <KEYWORD2>notifiers</KEYWORD2>
+            <KEYWORD2>optional</KEYWORD2>
+            <KEYWORD2>organization</KEYWORD2>
+            <KEYWORD2>organizationUrl</KEYWORD2>
+            <KEYWORD2>os</KEYWORD2>
+            <KEYWORD2>otherArchives</KEYWORD2>
+            <KEYWORD2>outputDirectory</KEYWORD2>
+            <KEYWORD2>packaging</KEYWORD2>
+            <KEYWORD2>parent</KEYWORD2>
+            <KEYWORD2>phase</KEYWORD2>
+            <KEYWORD2>pluginManagement</KEYWORD2>
+            <KEYWORD2>pluginRepositories</KEYWORD2>
+            <KEYWORD2>plugins</KEYWORD2>
+            <KEYWORD2>post</KEYWORD2>
+            <KEYWORD2>prerequisites</KEYWORD2>
+            <KEYWORD2>profiles</KEYWORD2>
+            <KEYWORD2>properties</KEYWORD2>
+            <KEYWORD2>property</KEYWORD2>
+            <KEYWORD2>relativePath</KEYWORD2>
+            <KEYWORD2>releases</KEYWORD2>
+            <KEYWORD2>relocation</KEYWORD2>
+            <KEYWORD2>reportSets</KEYWORD2>
+            <KEYWORD2>reporting</KEYWORD2>
+            <KEYWORD2>reports</KEYWORD2>
+            <KEYWORD2>repositories</KEYWORD2>
+            <KEYWORD2>repository</KEYWORD2>
+            <KEYWORD2>resources</KEYWORD2>
+            <KEYWORD2>roles</KEYWORD2>
+            <KEYWORD2>scm</KEYWORD2>
+            <KEYWORD2>scope</KEYWORD2>
+            <KEYWORD2>scriptSourceDirectory</KEYWORD2>
+            <KEYWORD2>sendOnError</KEYWORD2>
+            <KEYWORD2>sendOnFailure</KEYWORD2>
+            <KEYWORD2>sendOnSuccess</KEYWORD2>
+            <KEYWORD2>sendOnWarning</KEYWORD2>
+            <KEYWORD2>site</KEYWORD2>
+            <KEYWORD2>snapshotRepository</KEYWORD2>
+            <KEYWORD2>snapshots</KEYWORD2>
+            <KEYWORD2>sourceDirectory</KEYWORD2>
+            <KEYWORD2>status</KEYWORD2>
+            <KEYWORD2>subscribe</KEYWORD2>
+            <KEYWORD2>system</KEYWORD2>
+            <KEYWORD2>systemPath</KEYWORD2>
+            <KEYWORD2>tag</KEYWORD2>
+            <KEYWORD2>targetPath</KEYWORD2>
+            <KEYWORD2>testOutputDirectory</KEYWORD2>
+            <KEYWORD2>testResources</KEYWORD2>
+            <KEYWORD2>testSourceDirectory</KEYWORD2>
+            <KEYWORD2>timezone</KEYWORD2>
+            <KEYWORD2>type</KEYWORD2>
+            <KEYWORD2>uniqueVersion</KEYWORD2>
+            <KEYWORD2>unsubscribe</KEYWORD2>
+            <KEYWORD2>updatePolicy</KEYWORD2>
+            <KEYWORD2>url</KEYWORD2>
+            <KEYWORD2>value</KEYWORD2>
+            <KEYWORD2>version</KEYWORD2>
+
+            <KEYWORD3>contributor</KEYWORD3>
+            <KEYWORD3>dependency</KEYWORD3>
+            <KEYWORD3>developer</KEYWORD3>
+            <KEYWORD3>exclude</KEYWORD3>
+            <KEYWORD3>exclusion</KEYWORD3>
+            <KEYWORD3>execution</KEYWORD3>
+            <KEYWORD3>extension</KEYWORD3>
+            <KEYWORD3>filter</KEYWORD3>
+            <KEYWORD3>goal</KEYWORD3>
+            <KEYWORD3>include</KEYWORD3>
+            <KEYWORD3>license</KEYWORD3>
+            <KEYWORD3>mailingList</KEYWORD3>
+            <KEYWORD3>module</KEYWORD3>
+            <KEYWORD3>notifier</KEYWORD3>
+            <KEYWORD3>otherArchive</KEYWORD3>
+            <KEYWORD3>plugin</KEYWORD3>
+            <KEYWORD3>pluginRepository</KEYWORD3>
+            <KEYWORD3>profile</KEYWORD3>
+            <KEYWORD3>report</KEYWORD3>
+            <KEYWORD3>reportSet</KEYWORD3>
+            <KEYWORD3>repository</KEYWORD3>
+            <KEYWORD3>resource</KEYWORD3>
+            <KEYWORD3>role</KEYWORD3>
+            <KEYWORD3>testResource</KEYWORD3>
+        </KEYWORDS>
+    </RULES>
+	<!-- }}} -->
+	
+	<!-- {{{ DTD-TAGS -->
+    <RULES SET="DTD-TAGS" DEFAULT="KEYWORD2" IGNORE_CASE="FALSE">
+		<!-- SGML comment -->
+        <SPAN TYPE="COMMENT1">
+            <BEGIN><!--</BEGIN>
+            <END>--></END>
+        </SPAN>
+
+		<!-- SGML comment -->
+        <SPAN TYPE="COMMENT1">
+            <BEGIN>--</BEGIN>
+            <END>--</END>
+        </SPAN>
+
+		<!-- Parameter entities -->
+        <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
+            <BEGIN>%</BEGIN>
+            <END>;</END>
+        </SPAN>
+
+        <SPAN TYPE="LITERAL1">
+            <BEGIN>"</BEGIN>
+            <END>"</END>
+        </SPAN>
+
+        <SPAN TYPE="LITERAL1">
+            <BEGIN>'</BEGIN>
+            <END>'</END>
+        </SPAN>
+
+		<!-- This appears in some SGML documents -->
+        <SPAN TYPE="KEYWORD2" DELEGATE="MAIN">
+            <BEGIN>[</BEGIN>
+            <END>]</END>
+        </SPAN>
+
+        <SEQ TYPE="OPERATOR">(</SEQ>
+        <SEQ TYPE="OPERATOR">)</SEQ>
+        <SEQ TYPE="OPERATOR">|</SEQ>
+        <SEQ TYPE="OPERATOR">?</SEQ>
+        <SEQ TYPE="OPERATOR">*</SEQ>
+        <SEQ TYPE="OPERATOR">+</SEQ>
+        <SEQ TYPE="OPERATOR">,</SEQ>
+
+        <KEYWORDS>
+            <KEYWORD1>CDATA</KEYWORD1>
+            <KEYWORD1>EMPTY</KEYWORD1>
+            <KEYWORD1>INCLUDE</KEYWORD1>
+            <KEYWORD1>IGNORE</KEYWORD1>
+            <KEYWORD1>NDATA</KEYWORD1>
+            <KEYWORD1>#IMPLIED</KEYWORD1>
+            <KEYWORD1>#PCDATA</KEYWORD1>
+            <KEYWORD1>#REQUIRED</KEYWORD1>
+        </KEYWORDS>
+    </RULES>
+	<!-- }}} -->
+	
+	<!-- {{{ ENTITY-TAGS -->
+    <RULES SET="ENTITY-TAGS" DEFAULT="KEYWORD2">
+		<!-- SGML comment -->
+        <SPAN TYPE="COMMENT1">
+            <BEGIN><!--</BEGIN>
+            <END>--></END>
+        </SPAN>
+
+		<!-- SGML comment -->
+        <SPAN TYPE="COMMENT1">
+            <BEGIN>--</BEGIN>
+            <END>--</END>
+        </SPAN>
+
+        <SPAN TYPE="LITERAL1">
+            <BEGIN>"</BEGIN>
+            <END>"</END>
+        </SPAN>
+
+        <SPAN TYPE="LITERAL1">
+            <BEGIN>'</BEGIN>
+            <END>'</END>
+        </SPAN>
+
+        <SEQ TYPE="OPERATOR">=</SEQ>
+
+        <SEQ TYPE="OPERATOR">%</SEQ>
+
+        <KEYWORDS>
+            <KEYWORD1>SYSTEM</KEYWORD1>
+        </KEYWORDS>
+    </RULES>
+	<!-- }}} -->
+	
+	<!-- {{{ CDATA -->
+    <RULES SET="CDATA" DEFAULT="COMMENT2">
+        <KEYWORDS>
+            <LITERAL2>true</LITERAL2>
+            <LITERAL2>yes</LITERAL2>
+            <LITERAL2>false</LITERAL2>
+        </KEYWORDS>
+    </RULES>
+	<!-- }}} -->
+	
+	<!-- {{{ STRING -->
+    <RULES SET="STRING" DEFAULT="LITERAL1">
+		<!-- variables -->
+        <SPAN TYPE="KEYWORD4">
+            <BEGIN>${</BEGIN>
+            <END>}</END>
+        </SPAN>
+        <SEQ TYPE="NULL">\"</SEQ>
+        <SEQ TYPE="MARKUP" DELEGATE="TAGS">"</SEQ>
+
+        <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
+            <BEGIN>&</BEGIN>
+            <END>;</END>
+        </SPAN>
+        <KEYWORDS>
+            <LITERAL2>true</LITERAL2>
+            <LITERAL2>yes</LITERAL2>
+            <LITERAL2>false</LITERAL2>
+        </KEYWORDS>
+    </RULES>
+	<!-- }}} -->
+
+</MODE>
 
  	  	 
diff --git a/modes/nsis2.xml b/modes/nsis2.xml
index 42044fe..5497cdc 100644
--- a/modes/nsis2.xml
+++ b/modes/nsis2.xml
@@ -5,7 +5,7 @@
 <!--
 This is Nullsoft Scriptable Installation System mode by Ryan Grove 2003.
 Copyright (C) 2003 Ryan Grove
-Copyright (C) 2007 Uwe Stöhr (donovaly at users.sourceforge.net)
+Copyright (C) 2007-2012 Uwe Stöhr (donovaly at users.sourceforge.net)
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -22,7 +22,7 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 Updated for 4.3pre9 by Alan Ezust 2007
-$Id: nsis2.xml 21771 2012-06-08 18:38:27Z jarekczek $
+$Id: nsis2.xml 22465 2012-11-13 06:45:29Z ezust $
 -->
 
 <MODE>
@@ -50,17 +50,17 @@ $Id: nsis2.xml 21771 2012-06-08 18:38:27Z jarekczek $
 		<MARK_PREVIOUS TYPE="FUNCTION" MATCH_TYPE="OPERATOR">::</MARK_PREVIOUS>
 		<MARK_PREVIOUS TYPE="LABEL" MATCH_TYPE="OPERATOR">:</MARK_PREVIOUS>
 
-		<SPAN TYPE="LITERAL1" DELEGATE="NSIS_LITERAL">
+		<SPAN TYPE="LITERAL1" ESCAPE="$\" DELEGATE="NSIS_LITERAL">
 			<BEGIN>"</BEGIN>
 			<END>"</END>
 		</SPAN>
 
-		<SPAN TYPE="LITERAL1" DELEGATE="NSIS_LITERAL">
+		<SPAN TYPE="LITERAL1" ESCAPE="$\" DELEGATE="NSIS_LITERAL">
 			<BEGIN>'</BEGIN>
 			<END>'</END>
 		</SPAN>
 
-		<SPAN TYPE="LITERAL1" DELEGATE="NSIS_LITERAL">
+		<SPAN TYPE="LITERAL1" ESCAPE="$\" DELEGATE="NSIS_LITERAL">
 			<BEGIN>`</BEGIN>
 			<END>`</END>
 		</SPAN>
@@ -425,12 +425,14 @@ $Id: nsis2.xml 21771 2012-06-08 18:38:27Z jarekczek $
 			<KEYWORD2>setdatesave</KEYWORD2>
 			<KEYWORD2>setdetailsprint</KEYWORD2>
 			<KEYWORD2>setdetailsview</KEYWORD2>
+			<KEYWORD2>seterrorlevel</KEYWORD2>
 			<KEYWORD2>setfileattributes</KEYWORD2>
 			<KEYWORD2>setfont</KEYWORD2>
 			<KEYWORD2>setoutpath</KEYWORD2>
 			<KEYWORD2>setoverwrite</KEYWORD2>
 			<KEYWORD2>setpluginunload</KEYWORD2>
 			<KEYWORD2>setrebootflag</KEYWORD2>
+			<KEYWORD2>setregview</KEYWORD2>
 			<KEYWORD2>setshellvarcontext</KEYWORD2>
 			<KEYWORD2>setstaticbkcolor</KEYWORD2>
 			<KEYWORD2>setwindowlong</KEYWORD2>
diff --git a/modes/objective-c.xml b/modes/objective-c.xml
index 3e7c230..edc3b58 100644
--- a/modes/objective-c.xml
+++ b/modes/objective-c.xml
@@ -89,7 +89,7 @@
         <EOL_SPAN_REGEXP HASH_CHAR="elif" TYPE="MARKUP" DELEGATE="c::CONDITION">elif\b</EOL_SPAN_REGEXP>
         <EOL_SPAN_REGEXP HASH_CHAR="if" TYPE="MARKUP" DELEGATE="c::CONDITION">if\b</EOL_SPAN_REGEXP>
 
-        <IMPORT DELEGATE="LEX"/>
+        <IMPORT DELEGATE="c::LEX"/>
 
         <!-- Directives -->
         <KEYWORDS>
diff --git a/modes/objectrexx.xml b/modes/objectrexx.xml
index fae5fd7..835c71d 100644
--- a/modes/objectrexx.xml
+++ b/modes/objectrexx.xml
@@ -12,7 +12,7 @@
 		<PROPERTY NAME="lineComment" VALUE="--" />
 		<PROPERTY NAME="wordBreakChars" VALUE=",+-=<>/?^&*" />
 	</PROPS>
-	<RULES IGNORE_CASE="FALSE"
+	<RULES IGNORE_CASE="TRUE"
 		HIGHLIGHT_DIGITS="TRUE"
 		DIGIT_RE="(0x[\p{XDigit}]+[lL]?|[\p{Digit}]+(e[\p{Digit}]*)?[lLdDfF]?)">
 
diff --git a/modes/perl.xml b/modes/perl.xml
index 78e881f..781cf97 100644
--- a/modes/perl.xml
+++ b/modes/perl.xml
@@ -758,28 +758,6 @@
 		<SEQ TYPE="OPERATOR">-></SEQ>
 	</RULES>
 
-	<RULES SET="REGEXP" DEFAULT="MARKUP" ESCAPE="\">
-		<!-- ??? -->
-		<SEQ TYPE="MARKUP">)(</SEQ>
-	</RULES>
-
-	<RULES SET="SUB_NAME" DEFAULT="FUNCTION">
-		<EOL_SPAN TYPE="COMMENT1">#</EOL_SPAN>
-		<SPAN TYPE="OPERATOR" DELEGATE="SUB_PROTO">
-			<BEGIN>(</BEGIN>
-			<END>)</END>
-		</SPAN>
-	</RULES>
-
-	<RULES SET="SUB_PROTO" DEFAULT="LITERAL1">
-		<SEQ TYPE="LITERAL2">$</SEQ>
-		<SEQ TYPE="LITERAL2">@</SEQ>
-		<SEQ TYPE="LITERAL2">%</SEQ>
-		<SEQ TYPE="LITERAL2">&</SEQ>
-		<SEQ TYPE="LITERAL2">*</SEQ>
-		<SEQ TYPE="LITERAL3">\</SEQ>
-	</RULES>
-
 	<!-- Used for quote-like operators; just makes sure the brackets are balanced. -->
 	<RULES SET="QUOTED_BRACKET" DEFAULT="LITERAL1" ESCAPE="\">
 		<SPAN NO_LINE_BREAK="FALSE"
diff --git a/modes/pg-sql.xml b/modes/pg-sql.xml
new file mode 100644
index 0000000..348feef
--- /dev/null
+++ b/modes/pg-sql.xml
@@ -0,0 +1,1192 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE MODE SYSTEM "xmode.dtd">
+<!--
+   Thiemo Kellner, 2009-08-06
+   Eric Le Lay, 2013
+   mode for PosgreSQL 9.2 flavour of sql and PG-PL/SQL
+   based on ora-sql.xml
+   checked against http://www.postgresql.org/docs/9.2/static
+-->
+
+<MODE>
+   <PROPS>
+      <PROPERTY NAME="commentStart" VALUE="/*" />
+      <PROPERTY NAME="commentEnd" VALUE="*/" />
+      <PROPERTY NAME="lineComment" VALUE="--" />
+   </PROPS>
+   <RULES IGNORE_CASE="TRUE" HIGHLIGHT_DIGITS="TRUE">
+      <SPAN TYPE="COMMENT1">
+         <BEGIN>/*</BEGIN>
+         <END>*/</END>
+      </SPAN>
+
+      <SPAN TYPE="LITERAL1">
+         <BEGIN>"</BEGIN>
+         <END>"</END>
+      </SPAN>
+      <SPAN TYPE="LITERAL1">
+         <BEGIN>'</BEGIN>
+         <END>'</END>
+      </SPAN>
+
+      <!-- dollar-quoted (restricted tag name) -->
+      <SPAN_REGEXP HASH_CHAR="$" TYPE="LITERAL2">
+      <BEGIN><![CDATA[\$([\p{Alnum}_]*)\$]]></BEGIN>
+      <END REGEXP="TRUE">$1\$</END>
+      </SPAN_REGEXP>
+
+      <EOL_SPAN TYPE="COMMENT2">--</EOL_SPAN>
+
+      <MARK_PREVIOUS TYPE="FUNCTION"
+         MATCH_TYPE="OPERATOR">(</MARK_PREVIOUS>
+
+      <!--<MARK_PREVIOUS TYPE="FUNCTION"
+         MATCH_TYPE="OPERATOR"> (</MARK_PREVIOUS> interferes with structures like INSERT highlighting the table name as function -->
+
+      <MARK_PREVIOUS TYPE="LABEL" AT_LINE_START="TRUE">:</MARK_PREVIOUS>
+
+      <MARK_FOLLOWING TYPE="LITERAL3"
+         MATCH_TYPE="OPERATOR" AT_WHITESPACE_END="TRUE">\</MARK_FOLLOWING>
+
+      <SEQ TYPE="OPERATOR">&</SEQ>
+      <SEQ TYPE="OPERATOR">(</SEQ>
+      <SEQ TYPE="OPERATOR">)</SEQ>
+      <SEQ TYPE="OPERATOR">*</SEQ>
+      <SEQ TYPE="OPERATOR">+</SEQ>
+      <SEQ TYPE="OPERATOR">,</SEQ>
+      <SEQ TYPE="OPERATOR">-</SEQ>
+      <SEQ TYPE="OPERATOR">.</SEQ>
+      <SEQ TYPE="OPERATOR">/</SEQ>
+      <SEQ TYPE="OPERATOR">:</SEQ>
+      <SEQ TYPE="OPERATOR"><</SEQ>
+      <SEQ TYPE="OPERATOR"><<</SEQ>
+      <SEQ TYPE="OPERATOR">=</SEQ>
+      <SEQ TYPE="OPERATOR">></SEQ>
+      <SEQ TYPE="OPERATOR">>></SEQ>
+      <SEQ TYPE="OPERATOR">@</SEQ>
+      <SEQ TYPE="OPERATOR">[</SEQ>
+      <SEQ TYPE="OPERATOR">]</SEQ>
+      <SEQ TYPE="OPERATOR">^</SEQ>
+      <SEQ TYPE="OPERATOR">|</SEQ>
+      <SEQ TYPE="OPERATOR">%</SEQ>
+      <SEQ TYPE="OPERATOR">|/</SEQ>
+      <SEQ TYPE="OPERATOR">||/</SEQ>
+      <SEQ TYPE="OPERATOR">!</SEQ>
+      <SEQ TYPE="OPERATOR">!!</SEQ>
+      <SEQ TYPE="OPERATOR">@</SEQ>
+      <SEQ TYPE="OPERATOR">#</SEQ>
+      <SEQ TYPE="OPERATOR">~</SEQ>
+      <SEQ TYPE="OPERATOR">`</SEQ>
+
+      <KEYWORDS>
+         <!-- reserved and not so reserved words -->
+         <KEYWORD1>ABORT</KEYWORD1>
+         <KEYWORD1>ABSOLUTE</KEYWORD1>
+         <KEYWORD1>ACCESS</KEYWORD1>
+         <KEYWORD1>ACTION</KEYWORD1>
+         <KEYWORD1>ADD</KEYWORD1>
+         <KEYWORD1>ADMIN</KEYWORD1>
+         <KEYWORD1>AFTER</KEYWORD1>
+         <KEYWORD1>AGGREGATE</KEYWORD1>
+         <KEYWORD1>ALL</KEYWORD1>
+         <KEYWORD1>ALSO</KEYWORD1>
+         <KEYWORD1>ALTER</KEYWORD1>
+         <KEYWORD1>ALWAYS</KEYWORD1>
+         <KEYWORD1>ANALYSE</KEYWORD1>
+         <KEYWORD1>ANALYZE</KEYWORD1>
+         <KEYWORD1>AND</KEYWORD1>
+         <KEYWORD1>ANY</KEYWORD1>
+         <KEYWORD1>ARRAY</KEYWORD1>
+         <KEYWORD1>AS</KEYWORD1>
+         <KEYWORD1>ASC</KEYWORD1>
+         <KEYWORD1>ASSERTION</KEYWORD1>
+         <KEYWORD1>ASSIGNMENT</KEYWORD1>
+         <KEYWORD1>ASYMMETRIC</KEYWORD1>
+         <KEYWORD1>AT</KEYWORD1>
+         <KEYWORD1>ATTRIBUTE</KEYWORD1>
+         <KEYWORD1>AUTHORIZATION</KEYWORD1>
+         <KEYWORD1>BACKWARD</KEYWORD1>
+         <KEYWORD1>BEFORE</KEYWORD1>
+         <KEYWORD1>BEGIN</KEYWORD1>
+         <KEYWORD1>BETWEEN</KEYWORD1>
+         <KEYWORD1>BIGINT</KEYWORD1>
+         <KEYWORD1>BINARY</KEYWORD1>
+         <KEYWORD1>BIT</KEYWORD1>
+         <KEYWORD1>BOOLEAN</KEYWORD1>
+         <KEYWORD1>BOTH</KEYWORD1>
+         <KEYWORD1>BY</KEYWORD1>
+         <KEYWORD1>CACHE</KEYWORD1>
+         <KEYWORD1>CALLED</KEYWORD1>
+         <KEYWORD1>CASCADE</KEYWORD1>
+         <KEYWORD1>CASCADED</KEYWORD1>
+         <KEYWORD1>CASE</KEYWORD1>
+         <KEYWORD1>CAST</KEYWORD1>
+         <KEYWORD1>CATALOG</KEYWORD1>
+         <KEYWORD1>CHAIN</KEYWORD1>
+         <KEYWORD1>CHAR</KEYWORD1>
+         <KEYWORD1>CHARACTER</KEYWORD1>
+         <KEYWORD1>CHARACTERISTICS</KEYWORD1>
+         <KEYWORD1>CHECK</KEYWORD1>
+         <KEYWORD1>CHECKPOINT</KEYWORD1>
+         <KEYWORD1>CLASS</KEYWORD1>
+         <KEYWORD1>CLOSE</KEYWORD1>
+         <KEYWORD1>CLUSTER</KEYWORD1>
+         <!--<KEYWORD1>COALESCE</KEYWORD1> keyword2-->
+         <KEYWORD1>COLLATE</KEYWORD1>
+         <KEYWORD1>COLLATION</KEYWORD1>
+         <KEYWORD1>COLUMN</KEYWORD1>
+         <KEYWORD1>COMMENT</KEYWORD1>
+         <KEYWORD1>COMMENTS</KEYWORD1>
+         <KEYWORD1>COMMIT</KEYWORD1>
+         <KEYWORD1>COMMITTED</KEYWORD1>
+         <KEYWORD1>CONCURRENTLY</KEYWORD1>
+         <KEYWORD1>CONFIGURATION</KEYWORD1>
+         <KEYWORD1>CONNECTION</KEYWORD1>
+         <KEYWORD1>CONSTRAINT</KEYWORD1>
+         <KEYWORD1>CONSTRAINTS</KEYWORD1>
+         <KEYWORD1>CONTENT</KEYWORD1>
+         <KEYWORD1>CONTINUE</KEYWORD1>
+         <KEYWORD1>CONVERSION</KEYWORD1>
+         <KEYWORD1>COPY</KEYWORD1>
+         <KEYWORD1>COST</KEYWORD1>
+         <KEYWORD1>CREATE</KEYWORD1>
+         <KEYWORD1>CREATEDB</KEYWORD1> <!-- http://www.postgresql.org/docs/9.2/static/sql-createrole.html -->
+         <KEYWORD1>CREATEROLE</KEYWORD1> <!-- http://www.postgresql.org/docs/9.2/static/sql-createrole.html -->
+         <KEYWORD1>CREATEUSER</KEYWORD1> <!-- http://www.postgresql.org/docs/9.2/static/sql-createrole.html -->
+         <KEYWORD1>CROSS</KEYWORD1>
+         <KEYWORD1>CSV</KEYWORD1>
+         <KEYWORD1>CURRENT</KEYWORD1>
+         <KEYWORD1>CURRENT_CATALOG</KEYWORD1>
+         <!--<KEYWORD1>CURRENT_DATE</KEYWORD1>-->
+         <KEYWORD1>CURRENT_ROLE</KEYWORD1>
+         <KEYWORD1>CURRENT_SCHEMA</KEYWORD1>
+         <!--<KEYWORD1>CURRENT_TIME</KEYWORD1>-->
+         <!--<KEYWORD1>CURRENT_TIMESTAMP</KEYWORD1>-->
+         <KEYWORD1>CURRENT_USER</KEYWORD1>
+         <KEYWORD1>CURSOR</KEYWORD1>
+         <KEYWORD1>CYCLE</KEYWORD1>
+         <KEYWORD1>DATA</KEYWORD1>
+         <KEYWORD1>DATABASE</KEYWORD1>
+         <KEYWORD1>DAY</KEYWORD1>
+         <KEYWORD1>DEALLOCATE</KEYWORD1>
+         <KEYWORD1>DEC</KEYWORD1>
+         <KEYWORD1>DECIMAL</KEYWORD1>
+         <KEYWORD1>DECLARE</KEYWORD1>
+         <KEYWORD1>DEFAULT</KEYWORD1>
+         <KEYWORD1>DEFAULTS</KEYWORD1>
+         <KEYWORD1>DEFERRABLE</KEYWORD1>
+         <KEYWORD1>DEFERRED</KEYWORD1>
+         <KEYWORD1>DEFINER</KEYWORD1>
+         <KEYWORD1>DELETE</KEYWORD1>
+         <KEYWORD1>DELIMITER</KEYWORD1>
+         <KEYWORD1>DELIMITERS</KEYWORD1>
+         <KEYWORD1>DESC</KEYWORD1>
+         <KEYWORD1>DICTIONARY</KEYWORD1>
+         <KEYWORD1>DISABLE</KEYWORD1>
+         <KEYWORD1>DISCARD</KEYWORD1>
+         <KEYWORD1>DISTINCT</KEYWORD1>
+         <KEYWORD1>DO</KEYWORD1>
+         <KEYWORD1>DOCUMENT</KEYWORD1>
+         <KEYWORD1>DOMAIN</KEYWORD1>
+         <KEYWORD1>DOUBLE</KEYWORD1>
+         <KEYWORD1>DROP</KEYWORD1>
+         <KEYWORD1>EACH</KEYWORD1>
+         <KEYWORD1>ELSE</KEYWORD1>
+         <KEYWORD1>ENABLE</KEYWORD1>
+         <KEYWORD1>ENCODING</KEYWORD1>
+         <KEYWORD1>ENCRYPTED</KEYWORD1>
+         <KEYWORD1>END</KEYWORD1>
+         <KEYWORD1>ENUM</KEYWORD1>
+         <KEYWORD1>ESCAPE</KEYWORD1>
+         <KEYWORD1>EXCEPT</KEYWORD1>
+         <KEYWORD1>EXCEPTION</KEYWORD1> <!-- http://docs.postgresql.fr/9.2/plpgsql-control-structures.html#plpgsql-error-trapping -->
+         <KEYWORD1>EXCLUDE</KEYWORD1>
+         <KEYWORD1>EXCLUDING</KEYWORD1>
+         <KEYWORD1>EXCLUSIVE</KEYWORD1>
+         <KEYWORD1>EXECUTE</KEYWORD1>
+         <KEYWORD1>EXISTS</KEYWORD1>
+         <KEYWORD1>EXPLAIN</KEYWORD1>
+         <KEYWORD1>EXTENSION</KEYWORD1>
+         <KEYWORD1>EXTERNAL</KEYWORD1>
+         <!--<KEYWORD1>EXTRACT</KEYWORD1>-->
+         <KEYWORD1>FALSE</KEYWORD1>
+         <KEYWORD1>FAMILY</KEYWORD1>
+         <KEYWORD1>FETCH</KEYWORD1>
+         <KEYWORD1>FIRST</KEYWORD1>
+         <KEYWORD1>FLOAT</KEYWORD1>
+         <KEYWORD1>FOLLOWING</KEYWORD1>
+         <KEYWORD1>FOR</KEYWORD1>
+         <KEYWORD1>FORCE</KEYWORD1>
+         <KEYWORD1>FOREIGN</KEYWORD1>
+         <KEYWORD1>FORWARD</KEYWORD1>
+         <KEYWORD1>FREEZE</KEYWORD1>
+         <KEYWORD1>FROM</KEYWORD1>
+         <KEYWORD1>FULL</KEYWORD1>
+         <KEYWORD1>FUNCTION</KEYWORD1>
+         <KEYWORD1>FUNCTIONS</KEYWORD1>
+         <KEYWORD1>GLOBAL</KEYWORD1>
+         <KEYWORD1>GRANT</KEYWORD1>
+         <KEYWORD1>GRANTED</KEYWORD1>
+         <!--<KEYWORD1>GREATEST</KEYWORD1>-->
+         <KEYWORD1>GROUP</KEYWORD1>
+         <KEYWORD1>HANDLER</KEYWORD1>
+         <KEYWORD1>HAVING</KEYWORD1>
+         <KEYWORD1>HEADER</KEYWORD1>
+         <KEYWORD1>HOLD</KEYWORD1>
+         <KEYWORD1>HOUR</KEYWORD1>
+         <KEYWORD1>IDENTITY</KEYWORD1>
+         <KEYWORD1>ILIKE</KEYWORD1>
+         <KEYWORD1>IMMEDIATE</KEYWORD1>
+         <KEYWORD1>IMMUTABLE</KEYWORD1>
+         <KEYWORD1>IMPLICIT</KEYWORD1>
+         <KEYWORD1>IN</KEYWORD1>
+         <KEYWORD1>INCLUDING</KEYWORD1>
+         <KEYWORD1>INCREMENT</KEYWORD1>
+         <KEYWORD1>INDEX</KEYWORD1>
+         <KEYWORD1>INDEXES</KEYWORD1>
+         <KEYWORD1>INHERIT</KEYWORD1>
+         <KEYWORD1>INHERITS</KEYWORD1>
+         <KEYWORD1>INITIALLY</KEYWORD1>
+         <KEYWORD1>INLINE</KEYWORD1>
+         <KEYWORD1>INNER</KEYWORD1>
+         <KEYWORD1>INOUT</KEYWORD1>
+         <KEYWORD1>INPUT</KEYWORD1>
+         <KEYWORD1>INSENSITIVE</KEYWORD1>
+         <KEYWORD1>INSERT</KEYWORD1>
+         <KEYWORD1>INSTEAD</KEYWORD1>
+         <KEYWORD1>INT</KEYWORD1>
+         <KEYWORD1>INTEGER</KEYWORD1>
+         <KEYWORD1>INTERSECT</KEYWORD1>
+         <KEYWORD1>INTERVAL</KEYWORD1>
+         <KEYWORD1>INTO</KEYWORD1>
+         <KEYWORD1>INVOKER</KEYWORD1>
+         <KEYWORD1>IS</KEYWORD1>
+         <KEYWORD1>ISNULL</KEYWORD1>
+         <KEYWORD1>ISOLATION</KEYWORD1>
+         <KEYWORD1>JOIN</KEYWORD1>
+         <KEYWORD1>KEY</KEYWORD1>
+         <KEYWORD1>LABEL</KEYWORD1>
+         <KEYWORD1>LANGUAGE</KEYWORD1>
+         <KEYWORD1>LARGE</KEYWORD1>
+         <KEYWORD1>LAST</KEYWORD1>
+         <KEYWORD1>LC_COLLATE</KEYWORD1>
+         <KEYWORD1>LC_CTYPE</KEYWORD1>
+         <KEYWORD1>LEADING</KEYWORD1>
+         <KEYWORD1>LEAKPROOF</KEYWORD1>
+         <!--<KEYWORD1>LEAST</KEYWORD1>-->
+         <KEYWORD1>LEFT</KEYWORD1>
+         <KEYWORD1>LEVEL</KEYWORD1>
+         <KEYWORD1>LIKE</KEYWORD1>
+         <KEYWORD1>LIMIT</KEYWORD1>
+         <KEYWORD1>LISTEN</KEYWORD1>
+         <KEYWORD1>LOAD</KEYWORD1>
+         <KEYWORD1>LOCAL</KEYWORD1>
+         <!--<KEYWORD1>LOCALTIME</KEYWORD1>
+         <KEYWORD1>LOCALTIMESTAMP</KEYWORD1>-->
+         <KEYWORD1>LOCATION</KEYWORD1>
+         <KEYWORD1>LOCK</KEYWORD1>
+         <KEYWORD1>LOGIN</KEYWORD1> <!-- http://www.postgresql.org/docs/9.2/static/sql-createrole.html -->
+         <KEYWORD1>MAPPING</KEYWORD1>
+         <KEYWORD1>MATCH</KEYWORD1>
+         <KEYWORD1>MAXVALUE</KEYWORD1>
+         <KEYWORD1>MINUTE</KEYWORD1>
+         <KEYWORD1>MINVALUE</KEYWORD1>
+         <KEYWORD1>MODE</KEYWORD1>
+         <KEYWORD1>MONTH</KEYWORD1>
+         <KEYWORD1>MOVE</KEYWORD1>
+         <KEYWORD1>NAME</KEYWORD1>
+         <KEYWORD1>NAMES</KEYWORD1>
+         <KEYWORD1>NATIONAL</KEYWORD1>
+         <KEYWORD1>NATURAL</KEYWORD1>
+         <KEYWORD1>NCHAR</KEYWORD1>
+         <KEYWORD1>NEW</KEYWORD1> <!-- http://www.postgresql.org/docs/9.2/static/plpgsql-trigger.html -->
+         <KEYWORD1>NEXT</KEYWORD1>
+         <KEYWORD1>NO</KEYWORD1>
+         <KEYWORD1>NOCREATEDB</KEYWORD1> <!-- http://www.postgresql.org/docs/9.2/static/sql-createrole.html -->
+         <KEYWORD1>NOCREATEROLE</KEYWORD1> <!-- http://www.postgresql.org/docs/9.2/static/sql-createrole.html -->
+         <KEYWORD1>NOCREATEUSER</KEYWORD1> <!-- http://www.postgresql.org/docs/9.2/static/sql-createrole.html -->
+         <KEYWORD1>NOINHERIT</KEYWORD1>  <!-- http://www.postgresql.org/docs/9.2/static/sql-createrole.html -->
+         <KEYWORD1>NOLOGIN</KEYWORD1> <!-- http://www.postgresql.org/docs/9.2/static/sql-createrole.html -->
+         <KEYWORD1>NONE</KEYWORD1>
+         <KEYWORD1>NOSUPERUSER</KEYWORD1> <!-- http://www.postgresql.org/docs/9.2/static/sql-createrole.html -->
+         <KEYWORD1>NOT</KEYWORD1>
+         <KEYWORD1>NOTHING</KEYWORD1>
+         <KEYWORD1>NOTIFY</KEYWORD1>
+         <KEYWORD1>NOTNULL</KEYWORD1>
+         <KEYWORD1>NOWAIT</KEYWORD1>
+         <KEYWORD1>NULL</KEYWORD1>
+         <!--<KEYWORD1>NULLIF</KEYWORD1>-->
+         <KEYWORD1>NULLS</KEYWORD1>
+         <KEYWORD1>NUMERIC</KEYWORD1>
+         <KEYWORD1>OBJECT</KEYWORD1>
+         <KEYWORD1>OF</KEYWORD1>
+         <KEYWORD1>OFF</KEYWORD1>
+         <KEYWORD1>OFFSET</KEYWORD1>
+         <KEYWORD1>OIDS</KEYWORD1>
+         <KEYWORD1>OLD</KEYWORD1><!-- http://www.postgresql.org/docs/9.2/static/plpgsql-trigger.html -->
+         <KEYWORD1>ON</KEYWORD1>
+         <KEYWORD1>ONLY</KEYWORD1>
+         <KEYWORD1>OPERATOR</KEYWORD1>
+         <KEYWORD1>OPTION</KEYWORD1>
+         <KEYWORD1>OPTIONS</KEYWORD1>
+         <KEYWORD1>OR</KEYWORD1>
+         <KEYWORD1>ORDER</KEYWORD1>
+         <KEYWORD1>OUT</KEYWORD1>
+         <KEYWORD1>OUTER</KEYWORD1>
+         <KEYWORD1>OVER</KEYWORD1>
+         <KEYWORD1>OVERLAPS</KEYWORD1>
+         <KEYWORD1>OVERLAY</KEYWORD1>
+         <KEYWORD1>OWNED</KEYWORD1>
+         <KEYWORD1>OWNER</KEYWORD1>
+         <KEYWORD1>PARSER</KEYWORD1>
+         <KEYWORD1>PARTIAL</KEYWORD1>
+         <KEYWORD1>PARTITION</KEYWORD1>
+         <KEYWORD1>PASSING</KEYWORD1>
+         <KEYWORD1>PASSWORD</KEYWORD1>
+         <KEYWORD1>PLACING</KEYWORD1>
+         <KEYWORD1>PLANS</KEYWORD1>
+         <KEYWORD1>POSITION</KEYWORD1>
+         <KEYWORD1>PRECEDING</KEYWORD1>
+         <KEYWORD1>PRECISION</KEYWORD1>
+         <KEYWORD1>PREPARE</KEYWORD1>
+         <KEYWORD1>PREPARED</KEYWORD1>
+         <KEYWORD1>PRESERVE</KEYWORD1>
+         <KEYWORD1>PRIMARY</KEYWORD1>
+         <KEYWORD1>PRIOR</KEYWORD1>
+         <KEYWORD1>PRIVILEGES</KEYWORD1>
+         <KEYWORD1>PROCEDURAL</KEYWORD1>
+         <KEYWORD1>PROCEDURE</KEYWORD1>
+         <KEYWORD1>QUOTE</KEYWORD1>
+         <KEYWORD1>RANGE</KEYWORD1>
+         <KEYWORD1>READ</KEYWORD1>
+         <KEYWORD1>REAL</KEYWORD1>
+         <KEYWORD1>REASSIGN</KEYWORD1>
+         <KEYWORD1>RECHECK</KEYWORD1>
+         <KEYWORD1>RECURSIVE</KEYWORD1>
+         <KEYWORD1>REF</KEYWORD1>
+         <KEYWORD1>REFERENCES</KEYWORD1>
+         <KEYWORD1>REINDEX</KEYWORD1>
+         <KEYWORD1>RELATIVE</KEYWORD1>
+         <KEYWORD1>RELEASE</KEYWORD1>
+         <KEYWORD1>RENAME</KEYWORD1>
+         <KEYWORD1>REPEATABLE</KEYWORD1>
+         <KEYWORD1>REPLACE</KEYWORD1>
+         <KEYWORD1>REPLICA</KEYWORD1>
+         <KEYWORD1>RESET</KEYWORD1>
+         <KEYWORD1>RESTART</KEYWORD1>
+         <KEYWORD1>RESTRICT</KEYWORD1>
+         <KEYWORD1>RETURN</KEYWORD1> <!-- http://docs.postgresql.fr/9.2/plpgsql-control-structures.html -->
+         <KEYWORD1>RETURNING</KEYWORD1>
+         <KEYWORD1>RETURNS</KEYWORD1>
+         <KEYWORD1>REVOKE</KEYWORD1>
+         <KEYWORD1>RIGHT</KEYWORD1>
+         <KEYWORD1>ROLE</KEYWORD1>
+         <KEYWORD1>ROLLBACK</KEYWORD1>
+         <KEYWORD1>ROW</KEYWORD1>
+         <KEYWORD1>ROWS</KEYWORD1>
+         <KEYWORD1>RULE</KEYWORD1>
+         <KEYWORD1>SAVEPOINT</KEYWORD1>
+         <KEYWORD1>SCHEMA</KEYWORD1>
+         <KEYWORD1>SCROLL</KEYWORD1>
+         <KEYWORD1>SEARCH</KEYWORD1>
+         <KEYWORD1>SECOND</KEYWORD1>
+         <KEYWORD1>SECURITY</KEYWORD1>
+         <KEYWORD1>SELECT</KEYWORD1>
+         <KEYWORD1>SEQUENCE</KEYWORD1>
+         <KEYWORD1>SEQUENCES</KEYWORD1>
+         <KEYWORD1>SERIALIZABLE</KEYWORD1>
+         <KEYWORD1>SERVER</KEYWORD1>
+         <KEYWORD1>SESSION</KEYWORD1>
+         <KEYWORD1>SESSION_USER</KEYWORD1>
+         <KEYWORD1>SET</KEYWORD1>
+         <KEYWORD1>SETOF</KEYWORD1>
+         <KEYWORD1>SHARE</KEYWORD1>
+         <KEYWORD1>SHOW</KEYWORD1>
+         <KEYWORD1>SIMILAR</KEYWORD1>
+         <KEYWORD1>SIMPLE</KEYWORD1>
+         <KEYWORD1>SMALLINT</KEYWORD1>
+         <KEYWORD1>SNAPSHOT</KEYWORD1>
+         <!--<KEYWORD1>SOME</KEYWORD1>-->
+         <KEYWORD1>STABLE</KEYWORD1>
+         <KEYWORD1>STANDALONE</KEYWORD1>
+         <KEYWORD1>START</KEYWORD1>
+         <KEYWORD1>STATEMENT</KEYWORD1>
+         <KEYWORD1>STATISTICS</KEYWORD1>
+         <KEYWORD1>STDIN</KEYWORD1>
+         <KEYWORD1>STDOUT</KEYWORD1>
+         <KEYWORD1>STORAGE</KEYWORD1>
+         <KEYWORD1>STRICT</KEYWORD1>
+         <KEYWORD1>STRIP</KEYWORD1>
+         <KEYWORD1>SUBSTRING</KEYWORD1>
+         <KEYWORD1>SUPERUSER</KEYWORD1> <!-- http://www.postgresql.org/docs/9.2/static/sql-createrole.html -->
+         <KEYWORD1>SYMMETRIC</KEYWORD1>
+         <KEYWORD1>SYSID</KEYWORD1>
+         <KEYWORD1>SYSTEM</KEYWORD1>
+         <KEYWORD1>TABLE</KEYWORD1>
+         <KEYWORD1>TABLES</KEYWORD1>
+         <KEYWORD1>TABLESPACE</KEYWORD1>
+         <KEYWORD1>TEMP</KEYWORD1>
+         <KEYWORD1>TEMPLATE</KEYWORD1>
+         <KEYWORD1>TEMPORARY</KEYWORD1>
+         <KEYWORD1>TEXT</KEYWORD1>
+         <KEYWORD1>THEN</KEYWORD1>
+         <KEYWORD1>TIME</KEYWORD1>
+         <KEYWORD1>TIMESTAMP</KEYWORD1>
+         <KEYWORD1>TO</KEYWORD1>
+         <KEYWORD1>TRAILING</KEYWORD1>
+         <KEYWORD1>TRANSACTION</KEYWORD1>
+         <KEYWORD1>TREAT</KEYWORD1>
+         <KEYWORD1>TRIGGER</KEYWORD1>
+         <KEYWORD1>TRIM</KEYWORD1>
+         <KEYWORD1>TRUE</KEYWORD1>
+         <KEYWORD1>TRUNCATE</KEYWORD1>
+         <KEYWORD1>TRUSTED</KEYWORD1>
+         <KEYWORD1>TYPE</KEYWORD1>
+         <KEYWORD1>TYPES</KEYWORD1>
+         <KEYWORD1>UNBOUNDED</KEYWORD1>
+         <KEYWORD1>UNCOMMITTED</KEYWORD1>
+         <KEYWORD1>UNENCRYPTED</KEYWORD1>
+         <KEYWORD1>UNION</KEYWORD1>
+         <KEYWORD1>UNIQUE</KEYWORD1>
+         <KEYWORD1>UNKNOWN</KEYWORD1>
+         <KEYWORD1>UNLISTEN</KEYWORD1>
+         <KEYWORD1>UNLOGGED</KEYWORD1>
+         <KEYWORD1>UNTIL</KEYWORD1>
+         <KEYWORD1>UPDATE</KEYWORD1>
+         <KEYWORD1>USER</KEYWORD1>
+         <KEYWORD1>USING</KEYWORD1>
+         <KEYWORD1>VACUUM</KEYWORD1>
+         <KEYWORD1>VALID</KEYWORD1>
+         <KEYWORD1>VALIDATE</KEYWORD1>
+         <KEYWORD1>VALIDATOR</KEYWORD1>
+         <KEYWORD1>VALUE</KEYWORD1>
+         <KEYWORD1>VALUES</KEYWORD1>
+         <KEYWORD1>VARCHAR</KEYWORD1>
+         <KEYWORD1>VARIADIC</KEYWORD1>
+         <KEYWORD1>VARYING</KEYWORD1>
+         <KEYWORD1>VERBOSE</KEYWORD1>
+         <KEYWORD1>VERSION</KEYWORD1>
+         <KEYWORD1>VIEW</KEYWORD1>
+         <KEYWORD1>VOLATILE</KEYWORD1>
+         <KEYWORD1>WHEN</KEYWORD1>
+         <KEYWORD1>WHERE</KEYWORD1>
+         <KEYWORD1>WHITESPACE</KEYWORD1>
+         <KEYWORD1>WINDOW</KEYWORD1>
+         <KEYWORD1>WITH</KEYWORD1>
+         <KEYWORD1>WITHOUT</KEYWORD1>
+         <KEYWORD1>WORK</KEYWORD1>
+         <KEYWORD1>WRAPPER</KEYWORD1>
+         <KEYWORD1>WRITE</KEYWORD1>
+         <KEYWORD1>XML</KEYWORD1>
+         <KEYWORD1>XMLATTRIBUTES</KEYWORD1>
+         <KEYWORD1>XMLCONCAT</KEYWORD1>
+         <KEYWORD1>XMLELEMENT</KEYWORD1>
+         <KEYWORD1>XMLEXISTS</KEYWORD1>
+         <KEYWORD1>XMLFOREST</KEYWORD1>
+         <KEYWORD1>XMLPARSE</KEYWORD1>
+         <KEYWORD1>XMLPI</KEYWORD1>
+         <KEYWORD1>XMLROOT</KEYWORD1>
+         <KEYWORD1>XMLSERIALIZE</KEYWORD1>
+         <KEYWORD1>YEAR</KEYWORD1>
+         <KEYWORD1>YES</KEYWORD1>
+         <KEYWORD1>ZONE</KEYWORD1>
+
+         <!-- functions, procedures, packages, statements, types -->
+         <!--<KEYWORD2>ALL</KEYWORD2> already keyword1-->
+         <!--<KEYWORD2>AND</KEYWORD2> already keyword1-->
+         <!--<KEYWORD2>ANY</KEYWORD2> already keyword1-->
+         <KEYWORD2>AT TIME ZONE</KEYWORD2>
+         <!--<KEYWORD2>CASE</KEYWORD2> already keyword1-->
+         <KEYWORD2>COALESCE</KEYWORD2>
+         <KEYWORD2>CURRENT_TIME(</KEYWORD2>
+         <KEYWORD2>CURRENT_TIME</KEYWORD2>
+         <KEYWORD2>CURRENT_TIMESTAMP(</KEYWORD2>
+         <KEYWORD2>CURRENT_TIMESTAMP</KEYWORD2>
+         <!--<KEYWORD2>END</KEYWORD2> already keyword1-->
+         <!--<KEYWORD2>EXISTS</KEYWORD2> already keyword1-->
+         <KEYWORD2>EXTRACT</KEYWORD2>
+         <KEYWORD2>GREATEST</KEYWORD2>
+         <!--<KEYWORD2>IN</KEYWORD2> already keyword1-->
+         <KEYWORD2>LEAST</KEYWORD2>
+         <!--<KEYWORD2>LIKE</KEYWORD2> already keyword1-->
+         <KEYWORD2>LOCALTIME(</KEYWORD2>
+         <KEYWORD2>LOCALTIME</KEYWORD2>
+         <KEYWORD2>LOCALTIMESTAMP(</KEYWORD2>
+         <KEYWORD2>LOCALTIMESTAMP</KEYWORD2>
+         <KEYWORD2>NOT IN</KEYWORD2>
+         <!--<KEYWORD2>NOT</KEYWORD2> already keyword1-->
+         <KEYWORD2>NULLIF</KEYWORD2>
+         <!--<KEYWORD2>OR</KEYWORD2> already keyword1-->
+         <KEYWORD2>SIMILAR TO</KEYWORD2>
+         <KEYWORD2>SOME</KEYWORD2>
+         <!--<KEYWORD2>THEN</KEYWORD2> already keyword1-->
+         <!--<KEYWORD2>WHEN</KEYWORD2> already keyword1-->
+         <KEYWORD2>XMLEXISTS(</KEYWORD2>
+         <KEYWORD2>abbrev(</KEYWORD2>
+         <KEYWORD2>abs(</KEYWORD2>
+         <KEYWORD2>acos(</KEYWORD2>
+         <KEYWORD2>age(</KEYWORD2>
+         <KEYWORD2>area(</KEYWORD2>
+         <KEYWORD2>array_agg(</KEYWORD2>
+         <KEYWORD2>array_append(</KEYWORD2>
+         <KEYWORD2>array_cat(</KEYWORD2>
+         <KEYWORD2>array_dims(</KEYWORD2>
+         <KEYWORD2>array_fill(</KEYWORD2>
+         <KEYWORD2>array_length(</KEYWORD2>
+         <KEYWORD2>array_lower(</KEYWORD2>
+         <KEYWORD2>array_ndims(</KEYWORD2>
+         <KEYWORD2>array_prepend(</KEYWORD2>
+         <KEYWORD2>array_to_json(</KEYWORD2>
+         <KEYWORD2>array_to_string(</KEYWORD2>
+         <KEYWORD2>array_upper(</KEYWORD2>
+         <KEYWORD2>ascii(</KEYWORD2>
+         <KEYWORD2>ascii_to_mic</KEYWORD2>
+         <KEYWORD2>ascii_to_utf8</KEYWORD2>
+         <KEYWORD2>asin(</KEYWORD2>
+         <KEYWORD2>atan(</KEYWORD2>
+         <KEYWORD2>atan2(</KEYWORD2>
+         <KEYWORD2>avg(</KEYWORD2>
+         <KEYWORD2>big5_to_euc_tw</KEYWORD2>
+         <KEYWORD2>big5_to_mic</KEYWORD2>
+         <KEYWORD2>big5_to_utf8</KEYWORD2>
+         <KEYWORD2>bit_and(</KEYWORD2>
+         <KEYWORD2>bit_length(</KEYWORD2>
+         <KEYWORD2>bit_or(</KEYWORD2>
+         <KEYWORD2>bool_and(</KEYWORD2>
+         <KEYWORD2>bool_or(</KEYWORD2>
+         <KEYWORD2>box(</KEYWORD2>
+         <KEYWORD2>broadcast(</KEYWORD2>
+         <KEYWORD2>btrim(</KEYWORD2>
+         <KEYWORD2>cbrt(</KEYWORD2>
+         <KEYWORD2>ceil(</KEYWORD2>
+         <KEYWORD2>ceiling(</KEYWORD2>
+         <KEYWORD2>center(</KEYWORD2>
+         <KEYWORD2>char_length(</KEYWORD2>
+         <KEYWORD2>chr(</KEYWORD2>
+         <KEYWORD2>circle(</KEYWORD2>
+         <KEYWORD2>clock_timestamp(</KEYWORD2>
+         <KEYWORD2>col_description(</KEYWORD2>
+         <KEYWORD2>concat(</KEYWORD2>
+         <KEYWORD2>concat_ws(</KEYWORD2>
+         <KEYWORD2>convert(</KEYWORD2>
+         <KEYWORD2>convert_from(</KEYWORD2>
+         <KEYWORD2>convert_to(</KEYWORD2>
+         <KEYWORD2>corr(</KEYWORD2>
+         <KEYWORD2>cos(</KEYWORD2>
+         <KEYWORD2>cot(</KEYWORD2>
+         <KEYWORD2>count(</KEYWORD2>
+         <KEYWORD2>covar_pop(</KEYWORD2>
+         <KEYWORD2>covar_samp(</KEYWORD2>
+         <KEYWORD2>cume_dist(</KEYWORD2>
+         <KEYWORD2>current_catalog</KEYWORD2>
+         <KEYWORD2>current_database(</KEYWORD2>
+         <KEYWORD2>current_date</KEYWORD2>
+         <KEYWORD2>current_query(</KEYWORD2>
+         <KEYWORD2>current_schema</KEYWORD2>
+         <KEYWORD2>current_schema(</KEYWORD2>
+         <KEYWORD2>current_schemas(</KEYWORD2>
+         <KEYWORD2>current_setting(</KEYWORD2>
+         <KEYWORD2>current_time</KEYWORD2>
+         <KEYWORD2>current_timestamp</KEYWORD2>
+         <KEYWORD2>current_user</KEYWORD2>
+         <KEYWORD2>currval(</KEYWORD2>
+         <KEYWORD2>cursor_to_xml(</KEYWORD2>
+         <KEYWORD2>cursor_to_xmlschema(</KEYWORD2>
+         <KEYWORD2>database_to_xml(</KEYWORD2>
+         <KEYWORD2>database_to_xml_and_xmlschema(</KEYWORD2>
+         <KEYWORD2>database_to_xmlschema(</KEYWORD2>
+         <KEYWORD2>date_part(</KEYWORD2>
+         <KEYWORD2>date_trunc(</KEYWORD2>
+         <KEYWORD2>decode(</KEYWORD2>
+         <KEYWORD2>degrees(</KEYWORD2>
+         <KEYWORD2>dense_rank(</KEYWORD2>
+         <KEYWORD2>diameter(</KEYWORD2>
+         <KEYWORD2>div(</KEYWORD2>
+         <KEYWORD2>encode(</KEYWORD2>
+         <KEYWORD2>enum_first(</KEYWORD2>
+         <KEYWORD2>enum_last(</KEYWORD2>
+         <KEYWORD2>enum_range(</KEYWORD2>
+         <KEYWORD2>euc_cn_to_mic</KEYWORD2>
+         <KEYWORD2>euc_cn_to_utf8</KEYWORD2>
+         <KEYWORD2>euc_jis_2004_to_shift_jis_2004</KEYWORD2>
+         <KEYWORD2>euc_jis_2004_to_utf8</KEYWORD2>
+         <KEYWORD2>euc_jp_to_mic</KEYWORD2>
+         <KEYWORD2>euc_jp_to_sjis</KEYWORD2>
+         <KEYWORD2>euc_jp_to_utf8</KEYWORD2>
+         <KEYWORD2>euc_kr_to_mic</KEYWORD2>
+         <KEYWORD2>euc_kr_to_utf8</KEYWORD2>
+         <KEYWORD2>euc_tw_to_big5</KEYWORD2>
+         <KEYWORD2>euc_tw_to_mic</KEYWORD2>
+         <KEYWORD2>euc_tw_to_utf8</KEYWORD2>
+         <KEYWORD2>every(</KEYWORD2>
+         <KEYWORD2>exp(</KEYWORD2>
+         <KEYWORD2>extract(</KEYWORD2>
+         <KEYWORD2>family(</KEYWORD2>
+         <KEYWORD2>first_value(</KEYWORD2>
+         <KEYWORD2>floor(</KEYWORD2>
+         <KEYWORD2>format(</KEYWORD2>
+         <KEYWORD2>format_type(</KEYWORD2>
+         <KEYWORD2>gb18030_to_utf8</KEYWORD2>
+         <KEYWORD2>gbk_to_utf8</KEYWORD2>
+         <KEYWORD2>generate_series(</KEYWORD2>
+         <KEYWORD2>generate_subscripts(</KEYWORD2>
+         <KEYWORD2>get_bit(</KEYWORD2>
+         <KEYWORD2>get_byte(</KEYWORD2>
+         <KEYWORD2>get_current_ts_config(</KEYWORD2>
+         <KEYWORD2>has_any_column_privilege(</KEYWORD2>
+         <KEYWORD2>has_column_privilege(</KEYWORD2>
+         <KEYWORD2>has_database_privilege(</KEYWORD2>
+         <KEYWORD2>has_foreign_data_wrapper_privilege(</KEYWORD2>
+         <KEYWORD2>has_function_privilege(</KEYWORD2>
+         <KEYWORD2>has_language_privilege(</KEYWORD2>
+         <KEYWORD2>has_schema_privilege(</KEYWORD2>
+         <KEYWORD2>has_sequence_privilege(</KEYWORD2>
+         <KEYWORD2>has_server_privilege(</KEYWORD2>
+         <KEYWORD2>has_table_privilege(</KEYWORD2>
+         <KEYWORD2>has_tablespace_privilege(</KEYWORD2>
+         <KEYWORD2>height(</KEYWORD2>
+         <KEYWORD2>host(</KEYWORD2>
+         <KEYWORD2>hostmask(</KEYWORD2>
+         <KEYWORD2>inet_client_addr(</KEYWORD2>
+         <KEYWORD2>inet_client_port(</KEYWORD2>
+         <KEYWORD2>inet_server_addr(</KEYWORD2>
+         <KEYWORD2>inet_server_port(</KEYWORD2>
+         <KEYWORD2>initcap(</KEYWORD2>
+         <KEYWORD2>isclosed(</KEYWORD2>
+         <KEYWORD2>isempty(</KEYWORD2>
+         <KEYWORD2>isfinite(</KEYWORD2>
+         <KEYWORD2>iso_8859_1_to_mic</KEYWORD2>
+         <KEYWORD2>iso_8859_1_to_utf8</KEYWORD2>
+         <KEYWORD2>iso_8859_2_to_mic</KEYWORD2>
+         <KEYWORD2>iso_8859_2_to_utf8</KEYWORD2>
+         <KEYWORD2>iso_8859_2_to_windows_1250</KEYWORD2>
+         <KEYWORD2>iso_8859_3_to_mic</KEYWORD2>
+         <KEYWORD2>iso_8859_3_to_utf8</KEYWORD2>
+         <KEYWORD2>iso_8859_4_to_mic</KEYWORD2>
+         <KEYWORD2>iso_8859_4_to_utf8</KEYWORD2>
+         <KEYWORD2>iso_8859_5_to_koi8_r</KEYWORD2>
+         <KEYWORD2>iso_8859_5_to_mic</KEYWORD2>
+         <KEYWORD2>iso_8859_5_to_utf8</KEYWORD2>
+         <KEYWORD2>iso_8859_5_to_windows_866</KEYWORD2>
+         <KEYWORD2>iso_8859_5_to_windows_1251</KEYWORD2>
+         <KEYWORD2>iso_8859_6_to_utf8</KEYWORD2>
+         <KEYWORD2>iso_8859_7_to_utf8</KEYWORD2>
+         <KEYWORD2>iso_8859_8_to_utf8</KEYWORD2>
+         <KEYWORD2>iso_8859_9_to_utf8</KEYWORD2>
+         <KEYWORD2>iso_8859_10_to_utf8</KEYWORD2>
+         <KEYWORD2>iso_8859_13_to_utf8</KEYWORD2>
+         <KEYWORD2>iso_8859_14_to_utf8</KEYWORD2>
+         <KEYWORD2>iso_8859_15_to_utf8</KEYWORD2>
+         <KEYWORD2>iso_8859_16_to_utf8</KEYWORD2>
+         <KEYWORD2>isopen(</KEYWORD2>
+         <KEYWORD2>johab_to_utf8</KEYWORD2>
+         <KEYWORD2>justify_days(</KEYWORD2>
+         <KEYWORD2>justify_hours(</KEYWORD2>
+         <KEYWORD2>justify_interval(</KEYWORD2>
+         <KEYWORD2>koi8_r_to_iso_8859_5</KEYWORD2>
+         <KEYWORD2>koi8_r_to_mic</KEYWORD2>
+         <KEYWORD2>koi8_r_to_utf8</KEYWORD2>
+         <KEYWORD2>koi8_r_to_windows_866</KEYWORD2>
+         <KEYWORD2>koi8_r_to_windows_1251</KEYWORD2>
+         <KEYWORD2>koi8_u_to_utf8</KEYWORD2>
+         <KEYWORD2>lag(</KEYWORD2>
+         <KEYWORD2>last_value(</KEYWORD2>
+         <KEYWORD2>lastval(</KEYWORD2>
+         <KEYWORD2>lead(</KEYWORD2>
+         <KEYWORD2>left(</KEYWORD2>
+         <KEYWORD2>length(</KEYWORD2>
+         <KEYWORD2>ln(</KEYWORD2>
+         <KEYWORD2>localtime</KEYWORD2>
+         <KEYWORD2>localtimestamp</KEYWORD2>
+         <KEYWORD2>log(</KEYWORD2>
+         <KEYWORD2>lower(</KEYWORD2>
+         <KEYWORD2>lower_inc(</KEYWORD2>
+         <KEYWORD2>lower_inf(</KEYWORD2>
+         <KEYWORD2>lpad(</KEYWORD2>
+         <KEYWORD2>lseg(</KEYWORD2>
+         <KEYWORD2>ltrim(</KEYWORD2>
+         <KEYWORD2>masklen(</KEYWORD2>
+         <KEYWORD2>max(</KEYWORD2>
+         <KEYWORD2>md5(</KEYWORD2>
+         <KEYWORD2>mic_to_ascii</KEYWORD2>
+         <KEYWORD2>mic_to_big5</KEYWORD2>
+         <KEYWORD2>mic_to_euc_cn</KEYWORD2>
+         <KEYWORD2>mic_to_euc_jp</KEYWORD2>
+         <KEYWORD2>mic_to_euc_kr</KEYWORD2>
+         <KEYWORD2>mic_to_euc_tw</KEYWORD2>
+         <KEYWORD2>mic_to_iso_8859_1</KEYWORD2>
+         <KEYWORD2>mic_to_iso_8859_2</KEYWORD2>
+         <KEYWORD2>mic_to_iso_8859_3</KEYWORD2>
+         <KEYWORD2>mic_to_iso_8859_4</KEYWORD2>
+         <KEYWORD2>mic_to_iso_8859_5</KEYWORD2>
+         <KEYWORD2>mic_to_koi8_r</KEYWORD2>
+         <KEYWORD2>mic_to_sjis</KEYWORD2>
+         <KEYWORD2>mic_to_windows_866</KEYWORD2>
+         <KEYWORD2>mic_to_windows_1250</KEYWORD2>
+         <KEYWORD2>mic_to_windows_1251</KEYWORD2>
+         <KEYWORD2>min(</KEYWORD2>
+         <KEYWORD2>mod(</KEYWORD2>
+         <KEYWORD2>netmask(</KEYWORD2>
+         <KEYWORD2>network(</KEYWORD2>
+         <KEYWORD2>nextval(</KEYWORD2>
+         <KEYWORD2>now(</KEYWORD2>
+         <KEYWORD2>npoints(</KEYWORD2>
+         <KEYWORD2>nth_value(</KEYWORD2>
+         <KEYWORD2>ntile(</KEYWORD2>
+         <KEYWORD2>numnode(</KEYWORD2>
+         <KEYWORD2>obj_description(</KEYWORD2>
+         <KEYWORD2>octet_length(</KEYWORD2>
+         <KEYWORD2>overlay(</KEYWORD2>
+         <KEYWORD2>path(</KEYWORD2>
+         <KEYWORD2>pclose(</KEYWORD2>
+         <KEYWORD2>percent_rank(</KEYWORD2>
+         <KEYWORD2>pg_advisory_lock(</KEYWORD2>
+         <KEYWORD2>pg_advisory_lock_shared(</KEYWORD2>
+         <KEYWORD2>pg_advisory_unlock(</KEYWORD2>
+         <KEYWORD2>pg_advisory_unlock_all(</KEYWORD2>
+         <KEYWORD2>pg_advisory_unlock_shared(</KEYWORD2>
+         <KEYWORD2>pg_advisory_xact_lock(</KEYWORD2>
+         <KEYWORD2>pg_advisory_xact_lock_shared(</KEYWORD2>
+         <KEYWORD2>pg_backend_pid(</KEYWORD2>
+         <KEYWORD2>pg_cancel_backend(</KEYWORD2>
+         <KEYWORD2>pg_client_encoding(</KEYWORD2>
+         <KEYWORD2>pg_collation_is_visible(</KEYWORD2>
+         <KEYWORD2>pg_column_size(</KEYWORD2>
+         <KEYWORD2>pg_conf_load_time(</KEYWORD2>
+         <KEYWORD2>pg_conversion_is_visible(</KEYWORD2>
+         <KEYWORD2>pg_create_restore_point(</KEYWORD2>
+         <KEYWORD2>pg_current_xlog_insert_location(</KEYWORD2>
+         <KEYWORD2>pg_current_xlog_location(</KEYWORD2>
+         <KEYWORD2>pg_database_size(</KEYWORD2>
+         <KEYWORD2>pg_describe_object(</KEYWORD2>
+         <KEYWORD2>pg_export_snapshot(</KEYWORD2>
+         <KEYWORD2>pg_function_is_visible(</KEYWORD2>
+         <KEYWORD2>pg_get_constraintdef(</KEYWORD2>
+         <KEYWORD2>pg_get_expr(</KEYWORD2>
+         <KEYWORD2>pg_get_function_arguments(</KEYWORD2>
+         <KEYWORD2>pg_get_function_identity_arguments(</KEYWORD2>
+         <KEYWORD2>pg_get_function_result(</KEYWORD2>
+         <KEYWORD2>pg_get_functiondef(</KEYWORD2>
+         <KEYWORD2>pg_get_indexdef(</KEYWORD2>
+         <KEYWORD2>pg_get_keywords(</KEYWORD2>
+         <KEYWORD2>pg_get_ruledef(</KEYWORD2>
+         <KEYWORD2>pg_get_serial_sequence(</KEYWORD2>
+         <KEYWORD2>pg_get_triggerdef(</KEYWORD2>
+         <KEYWORD2>pg_get_userbyid(</KEYWORD2>
+         <KEYWORD2>pg_get_viewdef(</KEYWORD2>
+         <KEYWORD2>pg_has_role(</KEYWORD2>
+         <KEYWORD2>pg_indexes_size(</KEYWORD2>
+         <KEYWORD2>pg_is_in_recovery(</KEYWORD2>
+         <KEYWORD2>pg_is_other_temp_schema(</KEYWORD2>
+         <KEYWORD2>pg_is_xlog_replay_paused(</KEYWORD2>
+         <KEYWORD2>pg_last_xact_replay_timestamp(</KEYWORD2>
+         <KEYWORD2>pg_last_xlog_receive_location(</KEYWORD2>
+         <KEYWORD2>pg_last_xlog_replay_location(</KEYWORD2>
+         <KEYWORD2>pg_listening_channels(</KEYWORD2>
+         <KEYWORD2>pg_ls_dir(</KEYWORD2>
+         <KEYWORD2>pg_my_temp_schema(</KEYWORD2>
+         <KEYWORD2>pg_opclass_is_visible(</KEYWORD2>
+         <KEYWORD2>pg_operator_is_visible(</KEYWORD2>
+         <KEYWORD2>pg_opfamily_is_visible(</KEYWORD2>
+         <KEYWORD2>pg_options_to_table(</KEYWORD2>
+         <KEYWORD2>pg_postmaster_start_time(</KEYWORD2>
+         <KEYWORD2>pg_read_binary_file(</KEYWORD2>
+         <KEYWORD2>pg_read_file(</KEYWORD2>
+         <KEYWORD2>pg_relation_filenode(</KEYWORD2>
+         <KEYWORD2>pg_relation_filepath(</KEYWORD2>
+         <KEYWORD2>pg_relation_size(</KEYWORD2>
+         <KEYWORD2>pg_reload_conf(</KEYWORD2>
+         <KEYWORD2>pg_rotate_logfile(</KEYWORD2>
+         <KEYWORD2>pg_size_pretty(</KEYWORD2>
+         <KEYWORD2>pg_start_backup(</KEYWORD2>
+         <KEYWORD2>pg_stat_file(</KEYWORD2>
+         <KEYWORD2>pg_stop_backup(</KEYWORD2>
+         <KEYWORD2>pg_switch_xlog(</KEYWORD2>
+         <KEYWORD2>pg_table_is_visible(</KEYWORD2>
+         <KEYWORD2>pg_table_size(</KEYWORD2>
+         <KEYWORD2>pg_tablespace_databases(</KEYWORD2>
+         <KEYWORD2>pg_tablespace_location(</KEYWORD2>
+         <KEYWORD2>pg_tablespace_size(</KEYWORD2>
+         <KEYWORD2>pg_terminate_backend(</KEYWORD2>
+         <KEYWORD2>pg_total_relation_size(</KEYWORD2>
+         <KEYWORD2>pg_trigger_depth(</KEYWORD2>
+         <KEYWORD2>pg_try_advisory_lock(</KEYWORD2>
+         <KEYWORD2>pg_try_advisory_lock_shared(</KEYWORD2>
+         <KEYWORD2>pg_try_advisory_xact_lock(</KEYWORD2>
+         <KEYWORD2>pg_try_advisory_xact_lock_shared(</KEYWORD2>
+         <KEYWORD2>pg_ts_config_is_visible(</KEYWORD2>
+         <KEYWORD2>pg_ts_dict_is_visible(</KEYWORD2>
+         <KEYWORD2>pg_ts_parser_is_visible(</KEYWORD2>
+         <KEYWORD2>pg_ts_template_is_visible(</KEYWORD2>
+         <KEYWORD2>pg_type_is_visible(</KEYWORD2>
+         <KEYWORD2>pg_typeof(</KEYWORD2>
+         <KEYWORD2>pg_xlog_location_diff(</KEYWORD2>
+         <KEYWORD2>pg_xlog_replay_pause(</KEYWORD2>
+         <KEYWORD2>pg_xlog_replay_resume(</KEYWORD2>
+         <KEYWORD2>pg_xlogfile_name(</KEYWORD2>
+         <KEYWORD2>pg_xlogfile_name_offset(</KEYWORD2>
+         <KEYWORD2>pi(</KEYWORD2>
+         <KEYWORD2>plainto_tsquery(</KEYWORD2>
+         <KEYWORD2>point(</KEYWORD2>
+         <KEYWORD2>polygon(</KEYWORD2>
+         <KEYWORD2>popen(</KEYWORD2>
+         <KEYWORD2>position(</KEYWORD2>
+         <KEYWORD2>power(</KEYWORD2>
+         <KEYWORD2>query_to_xml(</KEYWORD2>
+         <KEYWORD2>query_to_xml_and_xmlschema(</KEYWORD2>
+         <KEYWORD2>query_to_xmlschema(</KEYWORD2>
+         <KEYWORD2>querytree(</KEYWORD2>
+         <KEYWORD2>quote_ident(</KEYWORD2>
+         <KEYWORD2>quote_literal(</KEYWORD2>
+         <KEYWORD2>quote_nullable(</KEYWORD2>
+         <KEYWORD2>radians(</KEYWORD2>
+         <KEYWORD2>radius(</KEYWORD2>
+         <KEYWORD2>random(</KEYWORD2>
+         <KEYWORD2>rank(</KEYWORD2>
+         <KEYWORD2>regexp_matches(</KEYWORD2>
+         <KEYWORD2>regexp_replace(</KEYWORD2>
+         <KEYWORD2>regexp_split_to_array(</KEYWORD2>
+         <KEYWORD2>regexp_split_to_table(</KEYWORD2>
+         <KEYWORD2>regr_avgx(</KEYWORD2>
+         <KEYWORD2>regr_avgy(</KEYWORD2>
+         <KEYWORD2>regr_count(</KEYWORD2>
+         <KEYWORD2>regr_intercept(</KEYWORD2>
+         <KEYWORD2>regr_r2(</KEYWORD2>
+         <KEYWORD2>regr_slope(</KEYWORD2>
+         <KEYWORD2>regr_sxx(</KEYWORD2>
+         <KEYWORD2>regr_sxy(</KEYWORD2>
+         <KEYWORD2>regr_syy(</KEYWORD2>
+         <KEYWORD2>repeat(</KEYWORD2>
+         <KEYWORD2>replace(</KEYWORD2>
+         <KEYWORD2>reverse(</KEYWORD2>
+         <KEYWORD2>right(</KEYWORD2>
+         <KEYWORD2>round(</KEYWORD2>
+         <KEYWORD2>row_number(</KEYWORD2>
+         <KEYWORD2>row_to_json(</KEYWORD2>
+         <KEYWORD2>rpad(</KEYWORD2>
+         <KEYWORD2>rtrim(</KEYWORD2>
+         <KEYWORD2>schema_to_xml(</KEYWORD2>
+         <KEYWORD2>schema_to_xml_and_xmlschema(</KEYWORD2>
+         <KEYWORD2>schema_to_xmlschema(</KEYWORD2>
+         <KEYWORD2>session_user</KEYWORD2>
+         <KEYWORD2>set_bit(</KEYWORD2>
+         <KEYWORD2>set_byte(</KEYWORD2>
+         <KEYWORD2>set_config(</KEYWORD2>
+         <KEYWORD2>set_masklen(</KEYWORD2>
+         <KEYWORD2>setseed(</KEYWORD2>
+         <KEYWORD2>setval(</KEYWORD2>
+         <KEYWORD2>setweight(</KEYWORD2>
+         <KEYWORD2>shift_jis_2004_to_euc_jis_2004</KEYWORD2>
+         <KEYWORD2>shift_jis_2004_to_utf8</KEYWORD2>
+         <KEYWORD2>shobj_description(</KEYWORD2>
+         <KEYWORD2>sign(</KEYWORD2>
+         <KEYWORD2>sin(</KEYWORD2>
+         <KEYWORD2>sjis_to_euc_jp</KEYWORD2>
+         <KEYWORD2>sjis_to_mic</KEYWORD2>
+         <KEYWORD2>sjis_to_utf8</KEYWORD2>
+         <KEYWORD2>split_part(</KEYWORD2>
+         <KEYWORD2>sqrt(</KEYWORD2>
+         <KEYWORD2>statement_timestamp(</KEYWORD2>
+         <KEYWORD2>stddev(</KEYWORD2>
+         <KEYWORD2>stddev_pop(</KEYWORD2>
+         <KEYWORD2>stddev_samp(</KEYWORD2>
+         <KEYWORD2>string_agg(</KEYWORD2>
+         <KEYWORD2>string_to_array(</KEYWORD2>
+         <KEYWORD2>strip(</KEYWORD2>
+         <KEYWORD2>strpos(</KEYWORD2>
+         <KEYWORD2>substr(</KEYWORD2>
+         <KEYWORD2>substring(</KEYWORD2>
+         <KEYWORD2>sum(</KEYWORD2>
+         <KEYWORD2>table_to_xml(</KEYWORD2>
+         <KEYWORD2>table_to_xml_and_xmlschema(</KEYWORD2>
+         <KEYWORD2>table_to_xmlschema(</KEYWORD2>
+         <KEYWORD2>tan(</KEYWORD2>
+         <KEYWORD2>tcvn_to_utf8</KEYWORD2>
+         <KEYWORD2>text(</KEYWORD2>
+         <KEYWORD2>timeofday(</KEYWORD2>
+         <KEYWORD2>to_ascii(</KEYWORD2>
+         <KEYWORD2>to_char(</KEYWORD2>
+         <KEYWORD2>to_date(</KEYWORD2>
+         <KEYWORD2>to_hex(</KEYWORD2>
+         <KEYWORD2>to_number(</KEYWORD2>
+         <KEYWORD2>to_timestamp(</KEYWORD2>
+         <KEYWORD2>to_tsquery(</KEYWORD2>
+         <KEYWORD2>to_tsvector(</KEYWORD2>
+         <KEYWORD2>transaction_timestamp(</KEYWORD2>
+         <KEYWORD2>translate(</KEYWORD2>
+         <KEYWORD2>trim(</KEYWORD2>
+         <KEYWORD2>trunc(</KEYWORD2>
+         <KEYWORD2>ts_debug(</KEYWORD2>
+         <KEYWORD2>ts_headline(</KEYWORD2>
+         <KEYWORD2>ts_lexize(</KEYWORD2>
+         <KEYWORD2>ts_parse(</KEYWORD2>
+         <KEYWORD2>ts_rank(</KEYWORD2>
+         <KEYWORD2>ts_rank_cd(</KEYWORD2>
+         <KEYWORD2>ts_rewrite(</KEYWORD2>
+         <KEYWORD2>ts_stat(</KEYWORD2>
+         <KEYWORD2>ts_token_type(</KEYWORD2>
+         <KEYWORD2>tsvector_update_trigger(</KEYWORD2>
+         <KEYWORD2>tsvector_update_trigger_column(</KEYWORD2>
+         <KEYWORD2>txid_current(</KEYWORD2>
+         <KEYWORD2>txid_current_snapshot(</KEYWORD2>
+         <KEYWORD2>txid_snapshot_xip(</KEYWORD2>
+         <KEYWORD2>txid_snapshot_xmax(</KEYWORD2>
+         <KEYWORD2>txid_snapshot_xmin(</KEYWORD2>
+         <KEYWORD2>txid_visible_in_snapshot(</KEYWORD2>
+         <KEYWORD2>uhc_to_utf8</KEYWORD2>
+         <KEYWORD2>unnest(</KEYWORD2>
+         <KEYWORD2>upper(</KEYWORD2>
+         <KEYWORD2>upper_inc(</KEYWORD2>
+         <KEYWORD2>upper_inf(</KEYWORD2>
+         <KEYWORD2>user</KEYWORD2>
+         <KEYWORD2>ut8_to_euc_jis_2004</KEYWORD2>
+         <KEYWORD2>ut8_to_shift_jis_2004</KEYWORD2>
+         <KEYWORD2>utf8_to_ascii</KEYWORD2>
+         <KEYWORD2>utf8_to_big5</KEYWORD2>
+         <KEYWORD2>utf8_to_euc_cn</KEYWORD2>
+         <KEYWORD2>utf8_to_euc_jp</KEYWORD2>
+         <KEYWORD2>utf8_to_euc_kr</KEYWORD2>
+         <KEYWORD2>utf8_to_euc_tw</KEYWORD2>
+         <KEYWORD2>utf8_to_gb18030</KEYWORD2>
+         <KEYWORD2>utf8_to_gbk</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_1</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_2</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_3</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_4</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_5</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_6</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_7</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_8</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_9</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_10</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_13</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_14</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_15</KEYWORD2>
+         <KEYWORD2>utf8_to_iso_8859_16</KEYWORD2>
+         <KEYWORD2>utf8_to_johab</KEYWORD2>
+         <KEYWORD2>utf8_to_koi8_r</KEYWORD2>
+         <KEYWORD2>utf8_to_koi8_u</KEYWORD2>
+         <KEYWORD2>utf8_to_sjis</KEYWORD2>
+         <KEYWORD2>utf8_to_tcvn</KEYWORD2>
+         <KEYWORD2>utf8_to_uhc</KEYWORD2>
+         <KEYWORD2>utf8_to_windows_866</KEYWORD2>
+         <KEYWORD2>utf8_to_windows_874</KEYWORD2>
+         <KEYWORD2>utf8_to_windows_1250</KEYWORD2>
+         <KEYWORD2>utf8_to_windows_1251</KEYWORD2>
+         <KEYWORD2>utf8_to_windows_1252</KEYWORD2>
+         <KEYWORD2>utf8_to_windows_1253</KEYWORD2>
+         <KEYWORD2>utf8_to_windows_1254</KEYWORD2>
+         <KEYWORD2>utf8_to_windows_1255</KEYWORD2>
+         <KEYWORD2>utf8_to_windows_1256</KEYWORD2>
+         <KEYWORD2>utf8_to_windows_1257</KEYWORD2>
+         <KEYWORD2>var_pop(</KEYWORD2>
+         <KEYWORD2>var_samp(</KEYWORD2>
+         <KEYWORD2>variance(</KEYWORD2>
+         <KEYWORD2>version(</KEYWORD2>
+         <KEYWORD2>width(</KEYWORD2>
+         <KEYWORD2>width_bucket(</KEYWORD2>
+         <KEYWORD2>windows_866_to_iso_8859_5</KEYWORD2>
+         <KEYWORD2>windows_866_to_koi8_r</KEYWORD2>
+         <KEYWORD2>windows_866_to_mic</KEYWORD2>
+         <KEYWORD2>windows_866_to_utf8</KEYWORD2>
+         <KEYWORD2>windows_866_to_windows_1251</KEYWORD2>
+         <KEYWORD2>windows_874_to_utf8</KEYWORD2>
+         <KEYWORD2>windows_1250_to_iso_8859_2</KEYWORD2>
+         <KEYWORD2>windows_1250_to_mic</KEYWORD2>
+         <KEYWORD2>windows_1250_to_utf8</KEYWORD2>
+         <KEYWORD2>windows_1251_to_iso_8859_5</KEYWORD2>
+         <KEYWORD2>windows_1251_to_koi8_r</KEYWORD2>
+         <KEYWORD2>windows_1251_to_mic</KEYWORD2>
+         <KEYWORD2>windows_1251_to_utf8</KEYWORD2>
+         <KEYWORD2>windows_1251_to_windows_866</KEYWORD2>
+         <KEYWORD2>windows_1252_to_utf8</KEYWORD2>
+         <KEYWORD2>windows_1256_to_utf8</KEYWORD2>
+         <KEYWORD2>xip_list</KEYWORD2>
+         <KEYWORD2>xmax</KEYWORD2>
+         <KEYWORD2>xmin</KEYWORD2>
+         <KEYWORD2>xml_is_well_formed(</KEYWORD2>
+         <KEYWORD2>xml_is_well_formed_content(</KEYWORD2>
+         <KEYWORD2>xml_is_well_formed_document(</KEYWORD2>
+         <KEYWORD2>xmlagg(</KEYWORD2>
+         <KEYWORD2>xmlcomment(</KEYWORD2>
+         <KEYWORD2>xmlconcat(</KEYWORD2>
+         <KEYWORD2>xmlelement(</KEYWORD2>
+         <KEYWORD2>xmlforest(</KEYWORD2>
+         <KEYWORD2>xmlpi(</KEYWORD2>
+         <KEYWORD2>xmlroot(</KEYWORD2>
+         <KEYWORD2>xpath(</KEYWORD2>
+         <KEYWORD2>xpath_exists(</KEYWORD2>
+
+         <!-- Catalog and information_schema 9.2 -->
+         <KEYWORD3>pg_aggregate</KEYWORD3>
+         <KEYWORD3>pg_am</KEYWORD3>
+         <KEYWORD3>pg_amop</KEYWORD3>
+         <KEYWORD3>pg_amproc</KEYWORD3>
+         <KEYWORD3>pg_attrdef</KEYWORD3>
+         <KEYWORD3>pg_attribute</KEYWORD3>
+         <KEYWORD3>pg_auth_members</KEYWORD3>
+         <KEYWORD3>pg_authid</KEYWORD3>
+         <KEYWORD3>pg_available_extension_versions</KEYWORD3>
+         <KEYWORD3>pg_available_extensions</KEYWORD3>
+         <KEYWORD3>pg_cast</KEYWORD3>
+         <KEYWORD3>pg_class</KEYWORD3>
+         <KEYWORD3>pg_collation</KEYWORD3>
+         <KEYWORD3>pg_constraint</KEYWORD3>
+         <KEYWORD3>pg_conversion</KEYWORD3>
+         <KEYWORD3>pg_cursors</KEYWORD3>
+         <KEYWORD3>pg_database</KEYWORD3>
+         <KEYWORD3>pg_db_role_setting</KEYWORD3>
+         <KEYWORD3>pg_default_acl</KEYWORD3>
+         <KEYWORD3>pg_depend</KEYWORD3>
+         <KEYWORD3>pg_description</KEYWORD3>
+         <KEYWORD3>pg_enum</KEYWORD3>
+         <KEYWORD3>pg_extension</KEYWORD3>
+         <KEYWORD3>pg_foreign_data_wrapper</KEYWORD3>
+         <KEYWORD3>pg_foreign_server</KEYWORD3>
+         <KEYWORD3>pg_foreign_table</KEYWORD3>
+         <KEYWORD3>pg_group</KEYWORD3>
+         <KEYWORD3>pg_index</KEYWORD3>
+         <KEYWORD3>pg_indexes</KEYWORD3>
+         <KEYWORD3>pg_inherits</KEYWORD3>
+         <KEYWORD3>pg_language</KEYWORD3>
+         <KEYWORD3>pg_largeobject</KEYWORD3>
+         <KEYWORD3>pg_largeobject_metadata</KEYWORD3>
+         <KEYWORD3>pg_locks</KEYWORD3>
+         <KEYWORD3>pg_namespace</KEYWORD3>
+         <KEYWORD3>pg_opclass</KEYWORD3>
+         <KEYWORD3>pg_operator</KEYWORD3>
+         <KEYWORD3>pg_opfamily</KEYWORD3>
+         <KEYWORD3>pg_pltemplate</KEYWORD3>
+         <KEYWORD3>pg_prepared_statements</KEYWORD3>
+         <KEYWORD3>pg_prepared_xacts</KEYWORD3>
+         <KEYWORD3>pg_proc</KEYWORD3>
+         <KEYWORD3>pg_range</KEYWORD3>
+         <KEYWORD3>pg_rewrite</KEYWORD3>
+         <KEYWORD3>pg_roles</KEYWORD3>
+         <KEYWORD3>pg_rules</KEYWORD3>
+         <KEYWORD3>pg_seclabel</KEYWORD3>
+         <KEYWORD3>pg_seclabels</KEYWORD3>
+         <KEYWORD3>pg_settings</KEYWORD3>
+         <KEYWORD3>pg_shadow</KEYWORD3>
+         <KEYWORD3>pg_shdepend</KEYWORD3>
+         <KEYWORD3>pg_shdescription</KEYWORD3>
+         <KEYWORD3>pg_shseclabel</KEYWORD3>
+         <KEYWORD3>pg_statistic</KEYWORD3>
+         <KEYWORD3>pg_stats</KEYWORD3>
+         <KEYWORD3>pg_tables</KEYWORD3>
+         <KEYWORD3>pg_tablespace</KEYWORD3>
+         <KEYWORD3>pg_timezone_abbrevs</KEYWORD3>
+         <KEYWORD3>pg_timezone_names</KEYWORD3>
+         <KEYWORD3>pg_trigger</KEYWORD3>
+         <KEYWORD3>pg_ts_config</KEYWORD3>
+         <KEYWORD3>pg_ts_config_map</KEYWORD3>
+         <KEYWORD3>pg_ts_dict</KEYWORD3>
+         <KEYWORD3>pg_ts_parser</KEYWORD3>
+         <KEYWORD3>pg_ts_template</KEYWORD3>
+         <KEYWORD3>pg_type</KEYWORD3>
+         <KEYWORD3>pg_user</KEYWORD3>
+         <KEYWORD3>pg_user_mapping</KEYWORD3>
+         <KEYWORD3>pg_user_mappings</KEYWORD3>
+         <KEYWORD3>pg_views</KEYWORD3>
+         <!-- -->
+         <KEYWORD3>administrable_role_authorizations</KEYWORD3>
+         <KEYWORD3>applicable_roles</KEYWORD3>
+         <KEYWORD3>attributes</KEYWORD3>
+         <KEYWORD3>character_sets</KEYWORD3>
+         <KEYWORD3>check_constraint_routine_usage</KEYWORD3>
+         <KEYWORD3>check_constraints</KEYWORD3>
+         <KEYWORD3>collation_character_set_applicability</KEYWORD3>
+         <KEYWORD3>collations</KEYWORD3>
+         <KEYWORD3>column_domain_usage</KEYWORD3>
+         <KEYWORD3>column_options</KEYWORD3>
+         <KEYWORD3>column_privileges</KEYWORD3>
+         <KEYWORD3>column_udt_usage</KEYWORD3>
+         <KEYWORD3>columns</KEYWORD3>
+         <KEYWORD3>constraint_column_usage</KEYWORD3>
+         <KEYWORD3>constraint_table_usage</KEYWORD3>
+         <KEYWORD3>data_type_privileges</KEYWORD3>
+         <KEYWORD3>domain_constraints</KEYWORD3>
+         <KEYWORD3>domain_udt_usage</KEYWORD3>
+         <KEYWORD3>domains</KEYWORD3>
+         <KEYWORD3>element_types</KEYWORD3>
+         <KEYWORD3>enabled_roles</KEYWORD3>
+         <KEYWORD3>foreign_data_wrapper_options</KEYWORD3>
+         <KEYWORD3>foreign_data_wrappers</KEYWORD3>
+         <KEYWORD3>foreign_server_options</KEYWORD3>
+         <KEYWORD3>foreign_servers</KEYWORD3>
+         <KEYWORD3>foreign_table_options</KEYWORD3>
+         <KEYWORD3>foreign_tables</KEYWORD3>
+         <KEYWORD3>information_schema_catalog_name</KEYWORD3>
+         <KEYWORD3>key_column_usage</KEYWORD3>
+         <KEYWORD3>parameters</KEYWORD3>
+         <KEYWORD3>referential_constraints</KEYWORD3>
+         <KEYWORD3>role_column_grants</KEYWORD3>
+         <KEYWORD3>role_routine_grants</KEYWORD3>
+         <KEYWORD3>role_table_grants</KEYWORD3>
+         <KEYWORD3>role_udt_grants</KEYWORD3>
+         <KEYWORD3>role_usage_grants</KEYWORD3>
+         <KEYWORD3>routine_privileges</KEYWORD3>
+         <KEYWORD3>routines</KEYWORD3>
+         <KEYWORD3>schemata</KEYWORD3>
+         <KEYWORD3>sequences</KEYWORD3>
+         <KEYWORD3>sql_features</KEYWORD3>
+         <KEYWORD3>sql_implementation_info</KEYWORD3>
+         <KEYWORD3>sql_languages</KEYWORD3>
+         <KEYWORD3>sql_packages</KEYWORD3>
+         <KEYWORD3>sql_parts</KEYWORD3>
+         <KEYWORD3>sql_sizing</KEYWORD3>
+         <KEYWORD3>sql_sizing_profiles</KEYWORD3>
+         <KEYWORD3>table_constraints</KEYWORD3>
+         <KEYWORD3>table_privileges</KEYWORD3>
+         <KEYWORD3>tables</KEYWORD3>
+         <KEYWORD3>triggered_update_columns</KEYWORD3>
+         <KEYWORD3>triggers</KEYWORD3>
+         <KEYWORD3>udt_privileges</KEYWORD3>
+         <KEYWORD3>usage_privileges</KEYWORD3>
+         <KEYWORD3>user_defined_types</KEYWORD3>
+         <KEYWORD3>user_mapping_options</KEYWORD3>
+         <KEYWORD3>user_mappings</KEYWORD3>
+         <KEYWORD3>view_column_usage</KEYWORD3>
+         <KEYWORD3>view_routine_usage</KEYWORD3>
+         <KEYWORD3>view_table_usage</KEYWORD3>
+         <KEYWORD3>views</KEYWORD3>
+
+         <!-- regexp -->
+         <KEYWORD4>alnum</KEYWORD4>
+         <KEYWORD4>alpha</KEYWORD4>
+         <KEYWORD4>blank</KEYWORD4>
+         <KEYWORD4>cntrl</KEYWORD4>
+         <KEYWORD4>digit</KEYWORD4>
+         <KEYWORD4>graph</KEYWORD4>
+         <KEYWORD4>lower</KEYWORD4>
+         <KEYWORD4>print</KEYWORD4>
+         <KEYWORD4>punct</KEYWORD4>
+         <KEYWORD4>space</KEYWORD4>
+         <KEYWORD4>upper</KEYWORD4>
+         <KEYWORD4>xdigit</KEYWORD4>
+
+         <!-- others -->
+         <KEYWORD1>IF</KEYWORD1>
+         <KEYWORD1>ELSIF</KEYWORD1>
+         <KEYWORD1>PERFORM</KEYWORD1>
+         <KEYWORD1>SERIAL</KEYWORD1>
+         <KEYWORD1>TEXT</KEYWORD1>
+         <KEYWORD1>ROWTYPE</KEYWORD1>
+         <KEYWORD1>VOID</KEYWORD1>
+         <KEYWORD4>RAISE</KEYWORD4>
+         <KEYWORD4>DEBUG</KEYWORD4>
+         <KEYWORD4>LOG</KEYWORD4>
+         <KEYWORD4>INFO</KEYWORD4>
+         <KEYWORD4>NOTICE</KEYWORD4>
+         <KEYWORD4>WARNING</KEYWORD4>
+         <!-- <KEYWORD4>EXCEPTION</KEYWORD4> already keyword1-->
+         <KEYWORD4>plpgsql</KEYWORD4>
+         <KEYWORD4>pltcl</KEYWORD4>
+         <KEYWORD4>pltclu</KEYWORD4>
+         <KEYWORD4>plperl</KEYWORD4>
+         <KEYWORD4>plperlu</KEYWORD4>
+         <KEYWORD4>plpythonu</KEYWORD4>
+      </KEYWORDS>
+   </RULES>
+</MODE>
diff --git a/modes/powerdynamo.xml b/modes/powerdynamo.xml
index ee5c1e4..246ca73 100644
--- a/modes/powerdynamo.xml
+++ b/modes/powerdynamo.xml
@@ -200,11 +200,11 @@ for the other tags (data, document, etc). more support planned for future.
 			<END>*/</END>
 		</SPAN>
 
-		<SPAN TYPE="LITERAL1" DELEGATE="powerdynamo_LITERAL">
+		<SPAN TYPE="LITERAL1">
 			<BEGIN>"</BEGIN>
 			<END>"</END>
 		</SPAN>
-		<SPAN TYPE="LITERAL1" DELEGATE="powerdynamo_LITERAL">
+		<SPAN TYPE="LITERAL1">
 			<BEGIN>'</BEGIN>
 			<END>'</END>
 		</SPAN>
@@ -413,11 +413,11 @@ for the other tags (data, document, etc). more support planned for future.
 	</RULES>
 
 	<RULES IGNORE_CASE="TRUE" SET="powerdynamo-tag-general">
-		<SPAN TYPE="LITERAL1" DELEGATE="powerdynamo_LITERAL">
+		<SPAN TYPE="LITERAL1">
 			<BEGIN>"</BEGIN>
 			<END>"</END>
 		</SPAN>
-		<SPAN TYPE="LITERAL1" DELEGATE="powerdynamo_LITERAL">
+		<SPAN TYPE="LITERAL1">
 			<BEGIN>'</BEGIN>
 			<END>'</END>
 		</SPAN>
@@ -428,11 +428,11 @@ for the other tags (data, document, etc). more support planned for future.
 	</RULES>
 
 	<RULES IGNORE_CASE="TRUE" SET="powerdynamo-tag-data">
-		<SPAN TYPE="LITERAL1" DELEGATE="powerdynamo_LITERAL">
+		<SPAN TYPE="LITERAL1">
 			<BEGIN>"</BEGIN>
 			<END>"</END>
 		</SPAN>
-		<SPAN TYPE="LITERAL1" DELEGATE="powerdynamo_LITERAL">
+		<SPAN TYPE="LITERAL1">
 			<BEGIN>'</BEGIN>
 			<END>'</END>
 		</SPAN>
@@ -444,11 +444,11 @@ for the other tags (data, document, etc). more support planned for future.
 	</RULES>
 
 	<RULES IGNORE_CASE="TRUE" SET="powerdynamo-tag-document">
-		<SPAN TYPE="LITERAL1" DELEGATE="powerdynamo_LITERAL">
+		<SPAN TYPE="LITERAL1">
 			<BEGIN>"</BEGIN>
 			<END>"</END>
 		</SPAN>
-		<SPAN TYPE="LITERAL1" DELEGATE="powerdynamo_LITERAL">
+		<SPAN TYPE="LITERAL1">
 			<BEGIN>'</BEGIN>
 			<END>'</END>
 		</SPAN>
diff --git a/modes/rfc.xml b/modes/rfc.xml
index 13d8363..6c1ac58 100644
--- a/modes/rfc.xml
+++ b/modes/rfc.xml
@@ -13,6 +13,7 @@
 			<BEGIN>"</BEGIN>
 			<END>"</END>
 		</SPAN>
+		<SEQ_REGEXP TYPE="MARKUP" AT_LINE_START="TRUE">\d.*</SEQ_REGEXP>
 		<KEYWORDS>
 			<!--{{{ Keyword list from RFC2119 -->
 			<KEYWORD1>MUST</KEYWORD1>
diff --git a/modes/ruby.xml b/modes/ruby.xml
index b29cd6f..0228c7e 100644
--- a/modes/ruby.xml
+++ b/modes/ruby.xml
@@ -34,7 +34,7 @@
 		<!-- Ruby comment (Inline Documentation ) -->
 		<SPAN TYPE="COMMENT2">
 			<BEGIN>=begin</BEGIN>
-			<END>=end</END>
+			<END AT_LINE_START="TRUE">=end</END>
 		</SPAN>
 
 		<!-- Class and instance vars -->
@@ -192,7 +192,7 @@
 			 document will terminate highlighting; I couldn't make it smarter. -->
 		<SPAN_REGEXP HASH_CHAR="<<" TYPE="LITERAL1" DELEGATE="doubleQuoteLiteral">
 			<BEGIN><<-?"([\p{Graph}]+)"</BEGIN>
-			<END>$1</END>
+			<END REGEXP="TRUE">^\S*$1$</END>
 		</SPAN_REGEXP>
 
 		<!-- Here documents <<'FOO' <<-'FOO' -->
@@ -201,7 +201,7 @@
 			 document will terminate highlighting; I couldn't make it smarter. -->
 		<SPAN_REGEXP HASH_CHAR="<<" TYPE="LITERAL1">
 			<BEGIN><<-?'([\p{Graph}]+)'</BEGIN>
-			<END>$1</END>
+			<END REGEXP="TRUE">^\S*$1$</END>
 		</SPAN_REGEXP>
 
 		<!-- Here documents <<FOO <<-FOO -->
@@ -210,7 +210,7 @@
 			 document will terminate highlighting; I couldn't make it smarter. -->
 		<SPAN_REGEXP HASH_CHAR="<<" TYPE="LITERAL1" DELEGATE="doubleQuoteLiteral">
 			<BEGIN><<-?([A-Za-z_]+)</BEGIN>
-			<END>$1</END>
+			<END REGEXP="TRUE">^\S*$1$</END>
 		</SPAN_REGEXP>
 
 		<!-- Shell command strings -->
@@ -356,15 +356,17 @@
 		<SPAN AT_WORD_START="TRUE" TYPE="LITERAL4">
 		  <BEGIN>:'</BEGIN> <END>'</END>
 		</SPAN>
+		<!-- bang = '!'
+		     :"hello world#{bang}" -->
+		<SPAN AT_WORD_START="TRUE" TYPE="LITERAL4" DELEGATE="doubleQuoteSymbol">
+		  <BEGIN>:"</BEGIN> <END>"</END>
+		</SPAN>
 
 		<!-- %s$Hello world$ -->
 		<SPAN_REGEXP HASH_CHAR="%s" TYPE="LITERAL4">
 		  <BEGIN>%s([^\p{Alnum}])</BEGIN>
 		  <END>$1</END>
     </SPAN_REGEXP>
-    <!-- Delegate contents of #{} expression in a double quoted symbol to MAIN so that
-    it will be syntax highlighted as well -->
-    
 		<KEYWORDS>
 			<KEYWORD1>BEGIN</KEYWORD1>
 			<KEYWORD1>END</KEYWORD1>
@@ -384,6 +386,8 @@
 			<KEYWORD1>in</KEYWORD1>
 			<KEYWORD1>module</KEYWORD1>
 			<KEYWORD1>next</KEYWORD1>
+			<KEYWORD1>print</KEYWORD1>
+			<KEYWORD1>puts</KEYWORD1>
 			<KEYWORD1>redo</KEYWORD1>
 			<KEYWORD1>rescue</KEYWORD1>
 			<KEYWORD1>retry</KEYWORD1>
@@ -451,6 +455,8 @@
 		<MARK_FOLLOWING TYPE="KEYWORD4">#@</MARK_FOLLOWING>
 		<MARK_FOLLOWING TYPE="NULL">#$</MARK_FOLLOWING>
 	</RULES>
+	<!-- Delegate contents of #{} expression in a double quoted symbol to MAIN so that
+	     it will be syntax highlighted as well -->
 	<RULES DEFAULT="LITERAL4" SET="doubleQuoteSymbol" ESCAPE="\">
       <SPAN DELEGATE="MAIN" TYPE="OPERATOR">
       <BEGIN>#{</BEGIN>
diff --git a/modes/rview.xml b/modes/rview.xml
index 0bd55c5..e56c81c 100644
--- a/modes/rview.xml
+++ b/modes/rview.xml
@@ -23,7 +23,7 @@
                 <SEQ TYPE="COMMENT1">/**/</SEQ>
 
 		<!-- Javadoc comment -->
-		<SPAN TYPE="COMMENT2" DELEGATE="JAVADOC">
+		<SPAN TYPE="COMMENT2" DELEGATE="java::JAVADOC">
 			<BEGIN>/**</BEGIN>
 			<END>*/</END>
 		</SPAN>
diff --git a/modes/shellscript.xml b/modes/shellscript.xml
index be740b1..c3f38b5 100644
--- a/modes/shellscript.xml
+++ b/modes/shellscript.xml
@@ -21,13 +21,13 @@
 		-->
 		<PROPERTY NAME="electricKeys" VALUE=")abcdefghijklmnopqrstuvwxyz" />
 	</PROPS>
-	<RULES IGNORE_CASE="TRUE" HIGHLIGHT_DIGITS="TRUE" ESCAPE="\">
+	<RULES IGNORE_CASE="TRUE" HIGHLIGHT_DIGITS="TRUE">
 		<!-- Comments -->
 		<EOL_SPAN TYPE="COMMENT2">#!</EOL_SPAN>
 		<EOL_SPAN TYPE="COMMENT1">#</EOL_SPAN>
 
-		<!-- Variables -->
-		<SPAN TYPE="KEYWORD2" NO_LINE_BREAK="TRUE">
+		<!-- BUG #3594428 (Bash Syntax Highlighting) -->
+		<SPAN TYPE="KEYWORD2" DELEGATE="LITERAL" NO_LINE_BREAK="TRUE">
 			<BEGIN>${</BEGIN>
 			<END>}</END>
 		</SPAN>
@@ -42,35 +42,35 @@
 		<MARK_PREVIOUS TYPE="KEYWORD2" MATCH_TYPE="OPERATOR">=</MARK_PREVIOUS>
 
 		<!-- weird stuff -->
-		<SPAN TYPE="KEYWORD3" DELEGATE="EXEC">
+		<SPAN TYPE="KEYWORD3" DELEGATE="EXEC" ESCAPE="\">
 			<BEGIN>$((</BEGIN>
 			<END>))</END>
 		</SPAN>
-		<SPAN TYPE="KEYWORD3" DELEGATE="EXEC">
+		<SPAN TYPE="KEYWORD3" DELEGATE="EXEC" ESCAPE="\">
 			<BEGIN>$(</BEGIN>
 			<END>)</END>
 		</SPAN>
-		<SPAN TYPE="KEYWORD3" DELEGATE="EXEC">
+		<SPAN TYPE="KEYWORD3" DELEGATE="EXEC" ESCAPE="\">
 			<BEGIN>$[</BEGIN>
 			<END>]</END>
 		</SPAN>
-		<SPAN TYPE="KEYWORD3" DELEGATE="EXEC">
+		<SPAN TYPE="KEYWORD3" DELEGATE="EXEC" ESCAPE="\">
 			<BEGIN>`</BEGIN>
 			<END>`</END>
 		</SPAN>
 
 		<!-- Literals -->
-		<SPAN TYPE="LITERAL1" DELEGATE="LITERAL">
+		<SPAN TYPE="LITERAL1" DELEGATE="LITERAL" ESCAPE="\">
 			<BEGIN>"</BEGIN>
 			<END>"</END>
 		</SPAN>
-		<SPAN TYPE="LITERAL1" ESCAPE="\">
+		<SPAN TYPE="LITERAL1">
 			<BEGIN>'</BEGIN>
 			<END>'</END>
 		</SPAN>
 
 		<!-- Readins -->
-		<SPAN_REGEXP HASH_CHAR="<<" TYPE="LITERAL1" DELEGATE="LITERAL">
+		<SPAN_REGEXP HASH_CHAR="<<" TYPE="LITERAL1" DELEGATE="LITERAL" ESCAPE="\">
 			<BEGIN><![CDATA[<<[\p{Space}'"]*([\p{Alnum}_]+)[\p{Space}'"]*]]></BEGIN>
 			<END AT_LINE_START="TRUE">$1</END>
 		</SPAN_REGEXP>
diff --git a/modes/tld.xml b/modes/tld.xml
index c77e2e6..828b13b 100644
--- a/modes/tld.xml
+++ b/modes/tld.xml
@@ -1,260 +1,257 @@
-<?xml version="1.0"?>
-<!DOCTYPE MODE SYSTEM "xmode.dtd">
-<!-- mode for tag library description (tld) files -->
-<MODE>
-    <PROPS>
-        <PROPERTY NAME="commentStart" VALUE="<!--" />
-        <PROPERTY NAME="commentEnd" VALUE="-->" />
-    </PROPS>
-	<!-- {{{ MAIN -->
-    <RULES>
-		<!-- SGML comment -->
-        <SPAN TYPE="COMMENT1">
-            <BEGIN><!--</BEGIN>
-            <END>--></END>
-        </SPAN>
-
-		<!-- DTD Entity declarations -->
-        <SPAN TYPE="KEYWORD2" DELEGATE="ENTITY-TAGS">
-            <BEGIN><!ENTITY</BEGIN>
-            <END>></END>
-        </SPAN>
-
-		<!-- CDATA sections -->
-        <SPAN TYPE="KEYWORD2" DELEGATE="CDATA">
-            <BEGIN><![CDATA[</BEGIN>
-            <END>]]></END>
-        </SPAN>
-
-		<!-- DTD instructions -->
-        <SPAN TYPE="KEYWORD2" DELEGATE="DTD-TAGS">
-            <BEGIN><!</BEGIN>
-            <END>></END>
-        </SPAN>
-
-		<!-- PI directives -->
-        <SPAN TYPE="KEYWORD3">
-            <BEGIN><?</BEGIN>
-            <END>></END>
-        </SPAN>
-
-		<!-- markup tags -->
-        <SPAN TYPE="MARKUP" DELEGATE="TAGS">
-            <BEGIN><</BEGIN>
-            <END>></END>
-        </SPAN>
-
-		<!-- SGML entities -->
-        <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
-            <BEGIN>&</BEGIN>
-            <END>;</END>
-        </SPAN>
-
-        <KEYWORDS>
-            <KEYWORD4>tagdependent</KEYWORD4>
-            <KEYWORD4>empty</KEYWORD4>
-            <KEYWORD4>scriptless</KEYWORD4>
-            <KEYWORD4>true</KEYWORD4>
-            <KEYWORD4>false</KEYWORD4>
-            <KEYWORD4>NESTED</KEYWORD4>
-            <KEYWORD4>AT_BEGIN</KEYWORD4>
-            <KEYWORD4>AT_END</KEYWORD4>
-        </KEYWORDS>
-
-    </RULES>
-	<!-- }}} -->
-	
-	<!-- {{{ TAGS -->
-    <RULES SET="TAGS" DEFAULT="MARKUP" NO_WORD_SEP="-_">
-		<!-- SGML comment -->
-        <SPAN TYPE="COMMENT1">
-            <BEGIN><!--</BEGIN>
-            <END>--></END>
-        </SPAN>
-
-        <SPAN TYPE="LITERAL1">
-            <BEGIN>"</BEGIN>
-            <END>"</END>
-        </SPAN>
-
-        <SPAN TYPE="LITERAL1">
-            <BEGIN>'</BEGIN>
-            <END>'</END>
-        </SPAN>
-
-        <SEQ TYPE="MARKUP" DELEGATE="STRING">"</SEQ>
-
-        <SEQ TYPE="MARKUP" DELEGATE="tld::MAIN">/></SEQ>
-        <MARK_PREVIOUS TYPE="LABEL">:</MARK_PREVIOUS>
-        <SEQ TYPE="OPERATOR">:</SEQ>
-        <KEYWORDS>
-            <KEYWORD1>taglib</KEYWORD1>
-            <KEYWORD1>tag</KEYWORD1>
-            <KEYWORD1>tag-file</KEYWORD1>
-            <KEYWORD1>function</KEYWORD1>
-            <KEYWORD1>tag-extension</KEYWORD1>
-            <KEYWORD1>validator</KEYWORD1>
-
-            <KEYWORD2>description</KEYWORD2>
-            <KEYWORD2>display-name</KEYWORD2>
-            <KEYWORD2>icon</KEYWORD2>
-            <KEYWORD2>tlib-version</KEYWORD2>
-            <KEYWORD2>short-name</KEYWORD2>
-            <KEYWORD2>uri</KEYWORD2>
-            <KEYWORD2>listener</KEYWORD2>
-            <KEYWORD2>validator-class</KEYWORD2>
-            <KEYWORD2>init-param</KEYWORD2>
-            <KEYWORD2>name</KEYWORD2>
-            <KEYWORD2>path</KEYWORD2>
-            <KEYWORD2>example</KEYWORD2>
-            <KEYWORD2>tag-extension</KEYWORD2>
-            <KEYWORD2>tag-class</KEYWORD2>
-            <KEYWORD2>tei-class</KEYWORD2>
-            <KEYWORD2>body-content</KEYWORD2>
-            <KEYWORD2>variable</KEYWORD2>
-            <KEYWORD2>attribute</KEYWORD2>
-            <KEYWORD2>dynamic-attributes</KEYWORD2>
-            <KEYWORD2>required</KEYWORD2>
-            <KEYWORD2>rtexprvalue</KEYWORD2>
-            <KEYWORD2>type</KEYWORD2>
-            <KEYWORD2>fragment</KEYWORD2>
-            <KEYWORD2>name-given</KEYWORD2>
-            <KEYWORD2>name-from-attribute</KEYWORD2>
-            <KEYWORD2>variable-class</KEYWORD2>
-            <KEYWORD2>declare</KEYWORD2>
-            <KEYWORD2>scope</KEYWORD2>
-
-
-        </KEYWORDS>
-    </RULES>
-	<!-- }}} -->
-	
-	<!-- {{{ DTD-TAGS -->
-    <RULES SET="DTD-TAGS" DEFAULT="KEYWORD2" IGNORE_CASE="FALSE">
-		<!-- SGML comment -->
-        <SPAN TYPE="COMMENT1">
-            <BEGIN><!--</BEGIN>
-            <END>--></END>
-        </SPAN>
-
-		<!-- SGML comment -->
-        <SPAN TYPE="COMMENT1">
-            <BEGIN>--</BEGIN>
-            <END>--</END>
-        </SPAN>
-
-		<!-- Parameter entities -->
-        <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
-            <BEGIN>%</BEGIN>
-            <END>;</END>
-        </SPAN>
-
-        <SPAN TYPE="LITERAL1">
-            <BEGIN>"</BEGIN>
-            <END>"</END>
-        </SPAN>
-
-        <SPAN TYPE="LITERAL1">
-            <BEGIN>'</BEGIN>
-            <END>'</END>
-        </SPAN>
-
-		<!-- This appears in some SGML documents -->
-        <SPAN TYPE="KEYWORD2" DELEGATE="MAIN">
-            <BEGIN>[</BEGIN>
-            <END>]</END>
-        </SPAN>
-
-        <SEQ TYPE="OPERATOR">(</SEQ>
-        <SEQ TYPE="OPERATOR">)</SEQ>
-        <SEQ TYPE="OPERATOR">|</SEQ>
-        <SEQ TYPE="OPERATOR">?</SEQ>
-        <SEQ TYPE="OPERATOR">*</SEQ>
-        <SEQ TYPE="OPERATOR">+</SEQ>
-        <SEQ TYPE="OPERATOR">,</SEQ>
-
-        <KEYWORDS>
-            <KEYWORD1>CDATA</KEYWORD1>
-            <KEYWORD1>EMPTY</KEYWORD1>
-            <KEYWORD1>INCLUDE</KEYWORD1>
-            <KEYWORD1>IGNORE</KEYWORD1>
-            <KEYWORD1>NDATA</KEYWORD1>
-            <KEYWORD1>#IMPLIED</KEYWORD1>
-            <KEYWORD1>#PCDATA</KEYWORD1>
-            <KEYWORD1>#REQUIRED</KEYWORD1>
-        </KEYWORDS>
-    </RULES>
-	<!-- }}} -->
-	
-	<!-- {{{ ENTITY-TAGS -->
-    <RULES SET="ENTITY-TAGS" DEFAULT="KEYWORD2">
-		<!-- SGML comment -->
-        <SPAN TYPE="COMMENT1">
-            <BEGIN><!--</BEGIN>
-            <END>--></END>
-        </SPAN>
-
-		<!-- SGML comment -->
-        <SPAN TYPE="COMMENT1">
-            <BEGIN>--</BEGIN>
-            <END>--</END>
-        </SPAN>
-
-        <SPAN TYPE="LITERAL1">
-            <BEGIN>"</BEGIN>
-            <END>"</END>
-        </SPAN>
-
-        <SPAN TYPE="LITERAL1">
-            <BEGIN>'</BEGIN>
-            <END>'</END>
-        </SPAN>
-
-        <SEQ TYPE="OPERATOR">=</SEQ>
-
-        <SEQ TYPE="OPERATOR">%</SEQ>
-
-        <KEYWORDS>
-            <KEYWORD1>SYSTEM</KEYWORD1>
-        </KEYWORDS>
-    </RULES>
-	<!-- }}} -->
-	
-	<!-- {{{ CDATA -->
-    <RULES SET="CDATA" DEFAULT="COMMENT2">
-        <KEYWORDS>
-            <LITERAL2>true</LITERAL2>
-            <LITERAL2>yes</LITERAL2>
-            <LITERAL2>false</LITERAL2>
-        </KEYWORDS>
-    </RULES>
-	<!-- }}} -->
-	
-	<!-- {{{ STRING -->
-    <RULES SET="STRING" DEFAULT="LITERAL1">
-		<!-- ant property -->
-        <SPAN TYPE="KEYWORD3">
-            <BEGIN>${</BEGIN>
-            <END>}</END>
-        </SPAN>
-        <SEQ TYPE="NULL">\"</SEQ>
-        <SEQ TYPE="MARKUP" DELEGATE="TAGS">"</SEQ>
-
-        <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
-            <BEGIN>&</BEGIN>
-            <END>;</END>
-        </SPAN>
-        <KEYWORDS>
-            <LITERAL2>true</LITERAL2>
-            <LITERAL2>yes</LITERAL2>
-            <LITERAL2>false</LITERAL2>
-        </KEYWORDS>
-    </RULES>
-	<!-- }}} -->
-
-    <RULES SET="BACK_TO_XML" DEFAULT="MARKUP">
-        <SEQ TYPE="MARKUP" DELEGATE="tld::TAGS">></SEQ>
-    </RULES>
-</MODE>
+<?xml version="1.0"?>
+<!DOCTYPE MODE SYSTEM "xmode.dtd">
+<!-- mode for tag library description (tld) files -->
+<MODE>
+    <PROPS>
+        <PROPERTY NAME="commentStart" VALUE="<!--" />
+        <PROPERTY NAME="commentEnd" VALUE="-->" />
+    </PROPS>
+	<!-- {{{ MAIN -->
+    <RULES>
+		<!-- SGML comment -->
+        <SPAN TYPE="COMMENT1">
+            <BEGIN><!--</BEGIN>
+            <END>--></END>
+        </SPAN>
+
+		<!-- DTD Entity declarations -->
+        <SPAN TYPE="KEYWORD2" DELEGATE="ENTITY-TAGS">
+            <BEGIN><!ENTITY</BEGIN>
+            <END>></END>
+        </SPAN>
+
+		<!-- CDATA sections -->
+        <SPAN TYPE="KEYWORD2" DELEGATE="CDATA">
+            <BEGIN><![CDATA[</BEGIN>
+            <END>]]></END>
+        </SPAN>
+
+		<!-- DTD instructions -->
+        <SPAN TYPE="KEYWORD2" DELEGATE="DTD-TAGS">
+            <BEGIN><!</BEGIN>
+            <END>></END>
+        </SPAN>
+
+		<!-- PI directives -->
+        <SPAN TYPE="KEYWORD3">
+            <BEGIN><?</BEGIN>
+            <END>></END>
+        </SPAN>
+
+		<!-- markup tags -->
+        <SPAN TYPE="MARKUP" DELEGATE="TAGS">
+            <BEGIN><</BEGIN>
+            <END>></END>
+        </SPAN>
+
+		<!-- SGML entities -->
+        <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
+            <BEGIN>&</BEGIN>
+            <END>;</END>
+        </SPAN>
+
+        <KEYWORDS>
+            <KEYWORD4>tagdependent</KEYWORD4>
+            <KEYWORD4>empty</KEYWORD4>
+            <KEYWORD4>scriptless</KEYWORD4>
+            <KEYWORD4>true</KEYWORD4>
+            <KEYWORD4>false</KEYWORD4>
+            <KEYWORD4>NESTED</KEYWORD4>
+            <KEYWORD4>AT_BEGIN</KEYWORD4>
+            <KEYWORD4>AT_END</KEYWORD4>
+        </KEYWORDS>
+
+    </RULES>
+	<!-- }}} -->
+	
+	<!-- {{{ TAGS -->
+    <RULES SET="TAGS" DEFAULT="MARKUP" NO_WORD_SEP="-_">
+		<!-- SGML comment -->
+        <SPAN TYPE="COMMENT1">
+            <BEGIN><!--</BEGIN>
+            <END>--></END>
+        </SPAN>
+
+        <SPAN TYPE="LITERAL1">
+            <BEGIN>"</BEGIN>
+            <END>"</END>
+        </SPAN>
+
+        <SPAN TYPE="LITERAL1">
+            <BEGIN>'</BEGIN>
+            <END>'</END>
+        </SPAN>
+
+        <SEQ TYPE="MARKUP" DELEGATE="STRING">"</SEQ>
+
+        <SEQ TYPE="MARKUP" DELEGATE="tld::MAIN">/></SEQ>
+        <MARK_PREVIOUS TYPE="LABEL">:</MARK_PREVIOUS>
+        <SEQ TYPE="OPERATOR">:</SEQ>
+        <KEYWORDS>
+            <KEYWORD1>taglib</KEYWORD1>
+            <KEYWORD1>tag</KEYWORD1>
+            <KEYWORD1>tag-file</KEYWORD1>
+            <KEYWORD1>function</KEYWORD1>
+            <KEYWORD1>tag-extension</KEYWORD1>
+            <KEYWORD1>validator</KEYWORD1>
+
+            <KEYWORD2>description</KEYWORD2>
+            <KEYWORD2>display-name</KEYWORD2>
+            <KEYWORD2>icon</KEYWORD2>
+            <KEYWORD2>tlib-version</KEYWORD2>
+            <KEYWORD2>short-name</KEYWORD2>
+            <KEYWORD2>uri</KEYWORD2>
+            <KEYWORD2>listener</KEYWORD2>
+            <KEYWORD2>validator-class</KEYWORD2>
+            <KEYWORD2>init-param</KEYWORD2>
+            <KEYWORD2>name</KEYWORD2>
+            <KEYWORD2>path</KEYWORD2>
+            <KEYWORD2>example</KEYWORD2>
+            <KEYWORD2>tag-extension</KEYWORD2>
+            <KEYWORD2>tag-class</KEYWORD2>
+            <KEYWORD2>tei-class</KEYWORD2>
+            <KEYWORD2>body-content</KEYWORD2>
+            <KEYWORD2>variable</KEYWORD2>
+            <KEYWORD2>attribute</KEYWORD2>
+            <KEYWORD2>dynamic-attributes</KEYWORD2>
+            <KEYWORD2>required</KEYWORD2>
+            <KEYWORD2>rtexprvalue</KEYWORD2>
+            <KEYWORD2>type</KEYWORD2>
+            <KEYWORD2>fragment</KEYWORD2>
+            <KEYWORD2>name-given</KEYWORD2>
+            <KEYWORD2>name-from-attribute</KEYWORD2>
+            <KEYWORD2>variable-class</KEYWORD2>
+            <KEYWORD2>declare</KEYWORD2>
+            <KEYWORD2>scope</KEYWORD2>
+
+
+        </KEYWORDS>
+    </RULES>
+	<!-- }}} -->
+	
+	<!-- {{{ DTD-TAGS -->
+    <RULES SET="DTD-TAGS" DEFAULT="KEYWORD2" IGNORE_CASE="FALSE">
+		<!-- SGML comment -->
+        <SPAN TYPE="COMMENT1">
+            <BEGIN><!--</BEGIN>
+            <END>--></END>
+        </SPAN>
+
+		<!-- SGML comment -->
+        <SPAN TYPE="COMMENT1">
+            <BEGIN>--</BEGIN>
+            <END>--</END>
+        </SPAN>
+
+		<!-- Parameter entities -->
+        <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
+            <BEGIN>%</BEGIN>
+            <END>;</END>
+        </SPAN>
+
+        <SPAN TYPE="LITERAL1">
+            <BEGIN>"</BEGIN>
+            <END>"</END>
+        </SPAN>
+
+        <SPAN TYPE="LITERAL1">
+            <BEGIN>'</BEGIN>
+            <END>'</END>
+        </SPAN>
+
+		<!-- This appears in some SGML documents -->
+        <SPAN TYPE="KEYWORD2" DELEGATE="MAIN">
+            <BEGIN>[</BEGIN>
+            <END>]</END>
+        </SPAN>
+
+        <SEQ TYPE="OPERATOR">(</SEQ>
+        <SEQ TYPE="OPERATOR">)</SEQ>
+        <SEQ TYPE="OPERATOR">|</SEQ>
+        <SEQ TYPE="OPERATOR">?</SEQ>
+        <SEQ TYPE="OPERATOR">*</SEQ>
+        <SEQ TYPE="OPERATOR">+</SEQ>
+        <SEQ TYPE="OPERATOR">,</SEQ>
+
+        <KEYWORDS>
+            <KEYWORD1>CDATA</KEYWORD1>
+            <KEYWORD1>EMPTY</KEYWORD1>
+            <KEYWORD1>INCLUDE</KEYWORD1>
+            <KEYWORD1>IGNORE</KEYWORD1>
+            <KEYWORD1>NDATA</KEYWORD1>
+            <KEYWORD1>#IMPLIED</KEYWORD1>
+            <KEYWORD1>#PCDATA</KEYWORD1>
+            <KEYWORD1>#REQUIRED</KEYWORD1>
+        </KEYWORDS>
+    </RULES>
+	<!-- }}} -->
+	
+	<!-- {{{ ENTITY-TAGS -->
+    <RULES SET="ENTITY-TAGS" DEFAULT="KEYWORD2">
+		<!-- SGML comment -->
+        <SPAN TYPE="COMMENT1">
+            <BEGIN><!--</BEGIN>
+            <END>--></END>
+        </SPAN>
+
+		<!-- SGML comment -->
+        <SPAN TYPE="COMMENT1">
+            <BEGIN>--</BEGIN>
+            <END>--</END>
+        </SPAN>
+
+        <SPAN TYPE="LITERAL1">
+            <BEGIN>"</BEGIN>
+            <END>"</END>
+        </SPAN>
+
+        <SPAN TYPE="LITERAL1">
+            <BEGIN>'</BEGIN>
+            <END>'</END>
+        </SPAN>
+
+        <SEQ TYPE="OPERATOR">=</SEQ>
+
+        <SEQ TYPE="OPERATOR">%</SEQ>
+
+        <KEYWORDS>
+            <KEYWORD1>SYSTEM</KEYWORD1>
+        </KEYWORDS>
+    </RULES>
+	<!-- }}} -->
+	
+	<!-- {{{ CDATA -->
+    <RULES SET="CDATA" DEFAULT="COMMENT2">
+        <KEYWORDS>
+            <LITERAL2>true</LITERAL2>
+            <LITERAL2>yes</LITERAL2>
+            <LITERAL2>false</LITERAL2>
+        </KEYWORDS>
+    </RULES>
+	<!-- }}} -->
+	
+	<!-- {{{ STRING -->
+    <RULES SET="STRING" DEFAULT="LITERAL1">
+		<!-- ant property -->
+        <SPAN TYPE="KEYWORD3">
+            <BEGIN>${</BEGIN>
+            <END>}</END>
+        </SPAN>
+        <SEQ TYPE="NULL">\"</SEQ>
+        <SEQ TYPE="MARKUP" DELEGATE="TAGS">"</SEQ>
+
+        <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
+            <BEGIN>&</BEGIN>
+            <END>;</END>
+        </SPAN>
+        <KEYWORDS>
+            <LITERAL2>true</LITERAL2>
+            <LITERAL2>yes</LITERAL2>
+            <LITERAL2>false</LITERAL2>
+        </KEYWORDS>
+    </RULES>
+	<!-- }}} -->
+
+</MODE>
 
  	  	 
diff --git a/modes/tthtml.xml b/modes/tthtml.xml
index 1bd96e3..11cece3 100644
--- a/modes/tthtml.xml
+++ b/modes/tthtml.xml
@@ -2,6 +2,8 @@
 <!DOCTYPE MODE SYSTEM "xmode.dtd">
 <MODE>
 	<!--
+		Edit mode for the Perl Template Toolkit
+		http://template-toolkit.org/index.html
 		Made by Krassimir Berov: k.berov at gmail.com
 	-->
 	<PROPS>
@@ -101,7 +103,8 @@
 			HIGHLIGHT_DIGITS="TRUE"
 			DIGIT_RE="(0x[\p{XDigit}]+[lL]?|[\p{Digit}]+(e[\p{Digit}]*)?[lLdDfF]?)">
 
-		<SPAN TYPE="KEYWORD2" NO_LINE_BREAK="TRUE" DELEGATE="VARIABLE">
+		<!-- example: [% users.${me.id}.name %] -->
+		<SPAN TYPE="KEYWORD2" NO_LINE_BREAK="TRUE" DELEGATE="perl::VARIABLE">
 			<BEGIN>${</BEGIN>
 			<END>}</END>
 		</SPAN>
diff --git a/modes/url.xml b/modes/url.xml
index c78bc50..5638bd5 100644
--- a/modes/url.xml
+++ b/modes/url.xml
@@ -32,11 +32,11 @@ http://www.example.com/p/t/f?id=2&var=true ('&' and 'var' do not get marked)
 		<MARK_PREVIOUS TYPE='LITERAL2' MATCH_TYPE='OPERATOR'>:</MARK_PREVIOUS>
 		<MARK_PREVIOUS TYPE='LITERAL2' MATCH_TYPE='OPERATOR'>/</MARK_PREVIOUS>
 
-		<SPAN_REGEXP DELEGATE='unwritten_AUTHORITY' MATCH_TYPE='LITERAL2' NO_LINE_BREAK='TRUE' NO_WORD_BREAK='TRUE'>
+		<SPAN_REGEXP MATCH_TYPE='LITERAL2' NO_LINE_BREAK='TRUE' NO_WORD_BREAK='TRUE'>
 			<BEGIN>(?=\b[\w.:-]+@(\b))</BEGIN> <!-- Why doesn't this match at the *boundary* between :// and <username>?  It's wrapped in a (?=<look ahead assertion>) -->
 			<END>$1</END>
 		</SPAN_REGEXP>
-		<SPAN_REGEXP DELEGATE='unwritten_HOSTNAME' MATCH_TYPE='LITERAL1' NO_LINE_BREAK='TRUE' NO_WORD_BREAK='TRUE'>
+		<SPAN_REGEXP MATCH_TYPE='LITERAL1' NO_LINE_BREAK='TRUE' NO_WORD_BREAK='TRUE'>
 			<BEGIN>(\b)[\w.-]+((?=/))</BEGIN>
 			<END>$1</END>
 		</SPAN_REGEXP>
diff --git a/modes/vala.xml b/modes/vala.xml
index 4e51ebe..46276ff 100644
--- a/modes/vala.xml
+++ b/modes/vala.xml
@@ -225,13 +225,13 @@
 		<!-- XXX: this is wrong, {@link ..} is correct, see below -->
 		<!--<SEQ TYPE="COMMENT3">{</SEQ>-->
 
-		<SPAN_REGEXP TYPE="LABEL" HASH_CHAR="{@" NO_WORD_BREAK="FALSE" DELEGATE="JAVADOC_PARAM">
+		<SPAN_REGEXP TYPE="LABEL" HASH_CHAR="{@" NO_WORD_BREAK="FALSE" DELEGATE="VALADOC_PARAM">
 			<BEGIN>\{@(link|linkplain|docRoot|code|literal)\s</BEGIN>
 			<END>}</END>
 		</SPAN_REGEXP>
 
 		<!-- for the common usage of the cvs keyword $Id: java.xml 19829 2011-08-24 09:32:24Z kpouer $ -->
-		<SPAN_REGEXP TYPE="LABEL" HASH_CHAR="@version" NO_WORD_BREAK="FALSE" DELEGATE="JAVADOC_PARAM">
+		<SPAN_REGEXP TYPE="LABEL" HASH_CHAR="@version" NO_WORD_BREAK="FALSE" DELEGATE="VALADOC_PARAM">
 			<BEGIN>@version\s+\$</BEGIN>
 			<END>$</END>
 		</SPAN_REGEXP>
@@ -239,7 +239,7 @@
 		<!-- This works only when you use the same whitespace before and after the param's name,
 			 eg. a tab before and after, but mixing space and tab won't work.
 			 The reason is that you can't enter a regexp in END, except for the backreference operator $n -->
-		<SPAN_REGEXP TYPE="LABEL" HASH_CHAR="@" NO_WORD_BREAK="FALSE" DELEGATE="JAVADOC_PARAM">
+		<SPAN_REGEXP TYPE="LABEL" HASH_CHAR="@" NO_WORD_BREAK="FALSE" DELEGATE="VALADOC_PARAM">
 			<BEGIN>@(?:param|throws|exception|serialField)(\s)</BEGIN>
 			<END>$1</END>
 		</SPAN_REGEXP>
@@ -310,5 +310,8 @@
 			<KEYWORD4>@values</KEYWORD4>
 		</KEYWORDS>
 	</RULES>
+	<!-- just a dummy which makes use of the default token type COMMENT4 for highlighting the word after @param in javadoc -->
+	<RULES SET="VALADOC_PARAM" DEFAULT="COMMENT4" IGNORE_CASE="TRUE" />
+
 </MODE>
 
diff --git a/modes/verilog.xml b/modes/verilog.xml
index 520f287..38a1ee5 100644
--- a/modes/verilog.xml
+++ b/modes/verilog.xml
@@ -20,7 +20,7 @@
 		<PROPERTY NAME="wordBreakChars" VALUE=",+-=<>/?^&*" />
 	</PROPS>
 	<RULES IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="TRUE"
-		DIGIT_RE="([\p{Digit}]|_)+" NO_WORD_SEP="'">
+        DIGIT_RE="([\p{Digit}]|_|[a-fA-F])+" NO_WORD_SEP="'">
 		<!-- Comments -->
 		<SPAN TYPE="COMMENT1">
 			<BEGIN>/*</BEGIN>
@@ -155,6 +155,7 @@
 			<KEYWORD3>input</KEYWORD3>
 			<KEYWORD3>output</KEYWORD3>
 			<KEYWORD3>inout</KEYWORD3>
+			<KEYWORD3>logic</KEYWORD3>
 
 			<!-- Signal Strengths -->
 			<KEYWORD3>supply0</KEYWORD3>
diff --git a/modes/xml.xml b/modes/xml.xml
index 01fba8c..0b01c38 100644
--- a/modes/xml.xml
+++ b/modes/xml.xml
@@ -57,12 +57,12 @@
 			<END>--></END>
 		</SPAN>
 
-		<SPAN TYPE="LITERAL1" NO_LINE_BREAK="FALSE">
+		<SPAN TYPE="LITERAL1" DELEGATE="STRING">
 			<BEGIN>"</BEGIN>
 			<END>"</END>
 		</SPAN>
 
-		<SPAN TYPE="LITERAL1" NO_LINE_BREAK="FALSE">
+		<SPAN TYPE="LITERAL1" DELEGATE="STRING">
 			<BEGIN>'</BEGIN>
 			<END>'</END>
 		</SPAN>
@@ -124,6 +124,13 @@
 			<KEYWORD1>#REQUIRED</KEYWORD1>
 		</KEYWORDS>
 	</RULES>
+ 	<RULES SET="STRING" DEFAULT="LITERAL1">
+ 		<SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
+ 			<BEGIN>&</BEGIN>
+ 			<END>;</END>
+ 		</SPAN>
+ 	</RULES>
+ 	<!-- }}} -->
 	<RULES SET="ENTITY-TAGS" DEFAULT="KEYWORD2">
 		<!-- SGML comment -->
 		<SPAN TYPE="COMMENT1">
diff --git a/modes/yaml.xml b/modes/yaml.xml
index dcdb15e..5bbfb4b 100644
--- a/modes/yaml.xml
+++ b/modes/yaml.xml
@@ -49,14 +49,12 @@ YAML mode by Jakub Roztočil <jakub at webkitchen.cz>
 		<SEQ TYPE="OPERATOR">,</SEQ>
 	</RULES>
 
-	<RULES SET="AFTER_NAME"></RULES>
-
 	<RULES SET="VALUES" HIGHLIGHT_DIGITS="TRUE">
 		<EOL_SPAN TYPE="COMMENT1" AT_LINE_START="FALSE">#</EOL_SPAN>
 		<IMPORT DELEGATE="NAME" />
 		<IMPORT DELEGATE="ARRAYS" />
 		<!-- Yaml forbids tabs -->
-		<SEQ_REGEXP TYPE="INVALID" DELEGATE="INVALID">\t</SEQ_REGEXP>
+		<SEQ_REGEXP TYPE="INVALID">\t</SEQ_REGEXP>
 		<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE">
 			<BEGIN>"</BEGIN>
 			<END>"</END>
diff --git a/org/gjt/sp/jedit/Abbrevs.java b/org/gjt/sp/jedit/Abbrevs.java
index 72fc68f..bf26453 100644
--- a/org/gjt/sp/jedit/Abbrevs.java
+++ b/org/gjt/sp/jedit/Abbrevs.java
@@ -1,6 +1,6 @@
 /*
  * Abbrevs.java - Abbreviation manager
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2004 Slava Pestov
@@ -33,7 +33,7 @@ import org.gjt.sp.util.Log;
 /**
  * Abbreviation manager.
  * @author Slava Pestov
- * @version $Id: Abbrevs.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: Abbrevs.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class Abbrevs
 {
diff --git a/org/gjt/sp/jedit/AbstractOptionPane.java b/org/gjt/sp/jedit/AbstractOptionPane.java
index 185e455..8d47ba8 100644
--- a/org/gjt/sp/jedit/AbstractOptionPane.java
+++ b/org/gjt/sp/jedit/AbstractOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * AbstractOptionPane.java - Abstract option pane
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 1999, 2000, 2001, 2002 Slava Pestov
@@ -56,7 +56,7 @@ import java.awt.*;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: AbstractOptionPane.java 21538 2012-04-01 10:10:44Z kpouer $
+ * @version $Id: AbstractOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
  */
 // even though this class is called AbstractOptionPane, it is not really
 // abstract, since BufferOptions uses an instance of it to lay out its
diff --git a/org/gjt/sp/jedit/ActionContext.java b/org/gjt/sp/jedit/ActionContext.java
index 5baa81e..fe009e7 100644
--- a/org/gjt/sp/jedit/ActionContext.java
+++ b/org/gjt/sp/jedit/ActionContext.java
@@ -1,6 +1,6 @@
 /*
  * ActionContext.java - For code sharing between jEdit and VFSBrowser
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2003 Slava Pestov
@@ -33,7 +33,7 @@ package org.gjt.sp.jedit;
  *
  * @since jEdit 4.2pre1
  * @author Slava Pestov
- * @version $Id: ActionContext.java 19264 2011-01-25 11:37:31Z kpouer $
+ * @version $Id: ActionContext.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public abstract class ActionContext extends JEditActionContext<EditAction, ActionSet>
 {
diff --git a/org/gjt/sp/jedit/ActionListHandler.java b/org/gjt/sp/jedit/ActionListHandler.java
index ca0eba4..3ff6657 100644
--- a/org/gjt/sp/jedit/ActionListHandler.java
+++ b/org/gjt/sp/jedit/ActionListHandler.java
@@ -1,6 +1,6 @@
 /*
  * ActionListHandler.java - XML handler for action files
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2001 Slava Pestov
diff --git a/org/gjt/sp/jedit/ActionSet.java b/org/gjt/sp/jedit/ActionSet.java
index 504f8e4..c6b3802 100644
--- a/org/gjt/sp/jedit/ActionSet.java
+++ b/org/gjt/sp/jedit/ActionSet.java
@@ -1,6 +1,6 @@
 /*
  * ActionSet.java - A set of actions
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2003 Slava Pestov
@@ -139,7 +139,7 @@ import org.gjt.sp.util.Log;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: ActionSet.java 20759 2012-01-12 11:06:22Z kpouer $
+ * @version $Id: ActionSet.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.0pre1
  */
 public class ActionSet extends JEditActionSet<EditAction> implements Comparable
diff --git a/org/gjt/sp/jedit/Autosave.java b/org/gjt/sp/jedit/Autosave.java
index 5bb011d..8b500de 100644
--- a/org/gjt/sp/jedit/Autosave.java
+++ b/org/gjt/sp/jedit/Autosave.java
@@ -1,6 +1,6 @@
 /*
  * Autosave.java - Autosave manager
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2003 Slava Pestov
@@ -31,7 +31,7 @@ import org.gjt.sp.util.Log;
 
 /**
  * @author Slava Pestov
- * @version $Id: Autosave.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: Autosave.java 21831 2012-06-18 22:54:17Z ezust $
  */
 class Autosave implements ActionListener
 {
diff --git a/org/gjt/sp/jedit/BeanShell.java b/org/gjt/sp/jedit/BeanShell.java
index 32fc708..f3ce696 100644
--- a/org/gjt/sp/jedit/BeanShell.java
+++ b/org/gjt/sp/jedit/BeanShell.java
@@ -1,6 +1,6 @@
 /*
  * BeanShell.java - BeanShell scripting support
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2004 Slava Pestov
@@ -23,13 +23,21 @@
 package org.gjt.sp.jedit;
 
 //{{{ Imports
-import org.gjt.sp.jedit.bsh.*;
-
-import java.io.*;
-import org.gjt.sp.jedit.io.*;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+
+import org.gjt.sp.jedit.bsh.BshMethod;
+import org.gjt.sp.jedit.bsh.EvalError;
+import org.gjt.sp.jedit.bsh.Interpreter;
+import org.gjt.sp.jedit.bsh.NameSpace;
+import org.gjt.sp.jedit.bsh.UtilEvalError;
 import org.gjt.sp.jedit.gui.BeanShellErrorDialog;
-import org.gjt.sp.jedit.textarea.*;
+import org.gjt.sp.jedit.io.VFSManager;
+import org.gjt.sp.jedit.textarea.JEditTextArea;
+import org.gjt.sp.jedit.textarea.Selection;
 import org.gjt.sp.util.Log;
+import org.gjt.sp.util.TaskManager;
 //}}}
 
 /**
@@ -50,12 +58,12 @@ import org.gjt.sp.util.Log;
  * </ul>
  *
  * @author Slava Pestov
- * @version $Id: BeanShell.java 19394 2011-02-24 13:24:54Z kpouer $
+ * @version $Id: BeanShell.java 22851 2013-03-17 11:03:48Z thomasmey $
  */
 public class BeanShell
 {
 	private static final BeanShellFacade<View> bsh = new MyBeanShellFacade();
-	
+
 	static void init()
 	{
 		Log.log(Log.MESSAGE, BeanShell.class, "Beanshell Init");
@@ -317,7 +325,7 @@ public class BeanShell
 					null,path,false);
 
 				if(!buffer.isLoaded())
-					VFSManager.waitForRequests();
+					TaskManager.instance.waitForIoTasks();
 
 				in = new StringReader(buffer.getText(0,
 					buffer.getLength()));
@@ -491,10 +499,11 @@ public class BeanShell
 			global.importPackage("org.gjt.sp.jedit.pluginmgr");
 			global.importPackage("org.gjt.sp.jedit.print");
 			global.importPackage("org.gjt.sp.jedit.search");
+			global.importPackage("org.jedit.io");
 		}
-		
+
 		@Override
-		protected void setupDefaultVariables(NameSpace namespace, View view) throws UtilEvalError 
+		protected void setupDefaultVariables(NameSpace namespace, View view) throws UtilEvalError
 		{
 			if(view != null)
 			{
@@ -528,6 +537,6 @@ public class BeanShell
 			else
 				new BeanShellErrorDialog(view,t);
 		}
-		
+
 	}
 }
diff --git a/org/gjt/sp/jedit/BeanShellAction.java b/org/gjt/sp/jedit/BeanShellAction.java
index 3e8c3f5..da5dd2c 100644
--- a/org/gjt/sp/jedit/BeanShellAction.java
+++ b/org/gjt/sp/jedit/BeanShellAction.java
@@ -1,6 +1,6 @@
 /*
  * BeanShellAction.java - BeanShell action
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2003 Slava Pestov
@@ -39,7 +39,7 @@ import org.gjt.sp.util.Log;
  * @see ActionSet
  *
  * @author Slava Pestov
- * @version $Id: BeanShellAction.java 13516 2008-09-03 19:40:47Z k_satoda $
+ * @version $Id: BeanShellAction.java 22715 2013-01-25 00:05:02Z daleanson $
  */
 public class BeanShellAction extends EditAction
 {
@@ -93,6 +93,8 @@ public class BeanShellAction extends EditAction
 		try
 		{
 			View view = GUIUtilities.getView(comp);
+			if (view == null)
+				view = jEdit.getActiveView();
 
 			// undocumented hack to allow browser actions to work.
 			// XXX - clean up in 4.3
diff --git a/org/gjt/sp/jedit/BeanShellFacade.java b/org/gjt/sp/jedit/BeanShellFacade.java
index 45e9484..391e3d7 100644
--- a/org/gjt/sp/jedit/BeanShellFacade.java
+++ b/org/gjt/sp/jedit/BeanShellFacade.java
@@ -1,6 +1,6 @@
 /*
  * BeanShellFacade.java - A BeanShell facade
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Matthieu Casanova
@@ -238,8 +238,6 @@ public abstract class BeanShellFacade<T>
 		}
 		catch(Exception e)
 		{
-			unwrapException(e);
-			// never called
 			return null;
 		}
 		finally
diff --git a/org/gjt/sp/jedit/Buffer.java b/org/gjt/sp/jedit/Buffer.java
index 82e0b0a..6926bc8 100644
--- a/org/gjt/sp/jedit/Buffer.java
+++ b/org/gjt/sp/jedit/Buffer.java
@@ -1,6 +1,6 @@
 /*
  * Buffer.java - jEdit buffer
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2005 Slava Pestov
@@ -34,6 +34,7 @@ import java.util.Map;
 import java.util.Vector;
 
 import javax.swing.*;
+import javax.swing.SwingWorker.StateValue;
 import javax.swing.text.Segment;
 
 import org.gjt.sp.jedit.browser.VFSBrowser;
@@ -42,6 +43,7 @@ import org.gjt.sp.jedit.buffer.FoldHandler;
 import org.gjt.sp.jedit.buffer.JEditBuffer;
 import org.gjt.sp.jedit.bufferio.BufferAutosaveRequest;
 import org.gjt.sp.jedit.bufferio.BufferIORequest;
+import org.gjt.sp.jedit.bufferio.IoTask;
 import org.gjt.sp.jedit.bufferio.MarkersSaveRequest;
 import org.gjt.sp.jedit.bufferset.BufferSet;
 import org.gjt.sp.jedit.gui.DockableWindowManager;
@@ -50,13 +52,13 @@ import org.gjt.sp.jedit.io.VFS;
 import org.gjt.sp.jedit.io.VFSFile;
 import org.gjt.sp.jedit.io.VFSManager;
 import org.gjt.sp.jedit.msg.BufferUpdate;
-import org.gjt.sp.jedit.options.GeneralOptionPane;
 import org.gjt.sp.jedit.syntax.ModeProvider;
 import org.gjt.sp.jedit.syntax.ParserRuleSet;
 import org.gjt.sp.jedit.syntax.TokenHandler;
 import org.gjt.sp.jedit.syntax.TokenMarker;
 import org.gjt.sp.jedit.visitors.JEditVisitorAdapter;
 import org.gjt.sp.jedit.visitors.SaveCaretInfoVisitor;
+import org.gjt.sp.util.AwtRunnableQueue;
 import org.gjt.sp.util.IntegerArray;
 import org.gjt.sp.util.Log;
 import org.gjt.sp.util.StandardUtilities;
@@ -90,7 +92,7 @@ import org.gjt.sp.util.ThreadUtilities;
 
  *
  * @author Slava Pestov
- * @version $Id: Buffer.java 22147 2012-09-03 18:51:56Z k_satoda $
+ * @version $Id: Buffer.java 22965 2013-05-02 09:49:17Z kpouer $
  */
 public class Buffer extends JEditBuffer
 {
@@ -259,11 +261,8 @@ public class Buffer extends JEditBuffer
 
 				// If the buffer is temporary, we don't need to
 				// call finishLoading() because it sets the FoldHandler
-				// and reload markers. But we always need to set the edit
-				// mode that is necessary for HyperSearch on directories
-				if (getFlag(TEMPORARY))
-					setMode();
-				else
+				// and reload markers.
+				if (!getFlag(TEMPORARY))
 					finishLoading();
 
 				setLoading(false);
@@ -302,7 +301,7 @@ public class Buffer extends JEditBuffer
 		if(getFlag(TEMPORARY))
 			runnable.run();
 		else
-			VFSManager.runInAWTThread(runnable);
+			AwtRunnableQueue.INSTANCE.runAfterIoTasks(runnable);
 
 		return true;
 	} //}}}
@@ -356,7 +355,7 @@ public class Buffer extends JEditBuffer
 
 		setFlag(AUTOSAVE_DIRTY,false);
 
-		VFSManager.runInWorkThread(new BufferAutosaveRequest(
+		ThreadUtilities.runInBackground(new BufferAutosaveRequest(
 			null,this,null,VFSManager.getFileVFS(),
 			autosaveFile.getPath()));
 	} //}}}
@@ -610,7 +609,7 @@ public class Buffer extends JEditBuffer
 		}
 
 		// Once save is complete, do a few other things
-		VFSManager.runInAWTThread(new Runnable()
+		AwtRunnableQueue.INSTANCE.runAfterIoTasks(new Runnable()
 			{
 				public void run()
 				{
@@ -623,11 +622,6 @@ public class Buffer extends JEditBuffer
 				}
 			});
 
-		int check = jEdit.getIntegerProperty("checkFileStatus");
-		if(!disableFileStatusCheck && (check == GeneralOptionPane.checkFileStatus_all ||
-					       check == GeneralOptionPane.checkFileStatus_operations))
-			jEdit.checkBufferStatus(view,false);
-
 		return true;
 	} //}}}
 
@@ -725,6 +719,19 @@ public class Buffer extends JEditBuffer
 		setFlag(AUTORELOAD, value);
 		autoreloadOverridden = isAutoreloadPropertyOverriden();
 	} //}}}
+//
+//	//{{{ getIoTask() method
+//	public IoTask getIoTask()
+//	{
+//		return ioTask;
+//	} //}}}
+//
+//	//{{{ setIoTask() method
+//	public void setIoTask(IoTask task)
+//	{
+//		assert(ioTask == null || ioTask != null && ioTask.getState() == StateValue.DONE);
+//		this.ioTask = task;
+//	} //}}}
 
 	//{{{ getAutoReloadDialog() method
 	/**
@@ -808,7 +815,7 @@ public class Buffer extends JEditBuffer
 	  */
 	public String getPath(Boolean shortVersion)
 	{
-		return shortVersion ? MiscUtilities.abbreviate(path) : getPath();
+		return shortVersion ? MiscUtilities.abbreviateView(path) : getPath();
 	} //}}}
 
 
@@ -1155,8 +1162,9 @@ public class Buffer extends JEditBuffer
 		if (mode != null)
 		{
 			int largeBufferSize = jEdit.getIntegerProperty("largeBufferSize", 4000000);
-			if (!getFlag(TEMPORARY) && getLength() > largeBufferSize && largeBufferSize != 0)
+			if (!getFlag(TEMPORARY) && getLength() > largeBufferSize && largeBufferSize > 0)
 			{
+				mode.loadIfNecessary();
 				boolean contextInsensitive = mode.getBooleanProperty("contextInsensitive");
 				String largeFileMode = jEdit.getProperty("largefilemode", "ask");
 				
@@ -1593,7 +1601,7 @@ public class Buffer extends JEditBuffer
 	@Override
 	public String toString()
 	{
-		return name + " (" + MiscUtilities.abbreviate(directory) + ')';
+		return name + " (" + MiscUtilities.abbreviateView(directory) + ')';
 	} //}}}
 
 	//{{{ addBufferUndoListener() method
@@ -1846,6 +1854,9 @@ public class Buffer extends JEditBuffer
 
 	private Socket waitSocket;
 	private List<BufferUndoListener> undoListeners;
+//
+//	/** the current ioTask of this buffer */
+//	private volatile IoTask ioTask;
 	//}}}
 
 	//{{{ setPath() method
@@ -1908,7 +1919,7 @@ public class Buffer extends JEditBuffer
 
 			// show this message when all I/O requests are
 			// complete
-			VFSManager.runInAWTThread(new Runnable()
+			AwtRunnableQueue.INSTANCE.runAfterIoTasks(new Runnable()
 			{
 				public void run()
 				{
@@ -2033,7 +2044,7 @@ public class Buffer extends JEditBuffer
 		final byte[] dummy = new byte[1];
 		if (!jEdit.getBooleanProperty("useMD5forDirtyCalculation"))
 			return dummy;
-		return StandardUtilities.md5(getText());
+		return StandardUtilities.md5(getSegment(0, getLength()));
 	}
 
 	/** Update the buffer's members with the current hash and length,
diff --git a/org/gjt/sp/jedit/BufferHistory.java b/org/gjt/sp/jedit/BufferHistory.java
index c6b12a0..7d24b3a 100644
--- a/org/gjt/sp/jedit/BufferHistory.java
+++ b/org/gjt/sp/jedit/BufferHistory.java
@@ -1,6 +1,6 @@
 /*
  * BufferHistory.java - Remembers caret positions
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2005 Slava Pestov
@@ -23,6 +23,7 @@
 package org.gjt.sp.jedit;
 
 //{{{ Imports
+import java.io.Closeable;
 import java.io.IOException;
 import java.util.*;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -40,7 +41,7 @@ import org.gjt.sp.util.IOUtilities;
 /**
  * Recent file list.
  * @author Slava Pestov
- * @version $Id: BufferHistory.java 19833 2011-08-25 12:01:54Z kpouer $
+ * @version $Id: BufferHistory.java 22948 2013-04-23 17:58:00Z thomasmey $
  */
 public class BufferHistory
 {
@@ -271,7 +272,7 @@ public class BufferHistory
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(out);
+			IOUtilities.closeQuietly((Closeable)out);
 		}
 	} //}}}
 
@@ -395,7 +396,7 @@ public class BufferHistory
 	//{{{ trimToLimit() method
 	private static void trimToLimit(Deque<Entry> list)
 	{
-		int max = jEdit.getIntegerProperty("recentFiles",50);
+		int max = jEdit.getIntegerProperty("recentFiles", 40);
 		while(list.size() > max)
 			list.removeLast();
 	} //}}}
diff --git a/org/gjt/sp/jedit/Debug.java b/org/gjt/sp/jedit/Debug.java
index e8a179d..ebe4a04 100644
--- a/org/gjt/sp/jedit/Debug.java
+++ b/org/gjt/sp/jedit/Debug.java
@@ -1,6 +1,6 @@
 /*
  * Debug.java - Various debugging flags
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -27,7 +27,7 @@ package org.gjt.sp.jedit;
  * development) and debugging routines.
  * @since jEdit 4.2pre1
  * @author Slava Pestov
- * @version $Id: Debug.java 21735 2012-05-29 17:06:05Z jarekczek $
+ * @version $Id: Debug.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class Debug
 {
diff --git a/org/gjt/sp/jedit/EBMessage.java b/org/gjt/sp/jedit/EBMessage.java
index 13af706..8eee381 100644
--- a/org/gjt/sp/jedit/EBMessage.java
+++ b/org/gjt/sp/jedit/EBMessage.java
@@ -1,6 +1,6 @@
 /*
  * EBMessage.java - An EditBus message
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2002 Slava Pestov
@@ -34,7 +34,7 @@ package org.gjt.sp.jedit;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: EBMessage.java 12625 2008-05-11 12:07:29Z kpouer $
+ * @version $Id: EBMessage.java 21831 2012-06-18 22:54:17Z ezust $
  *
  * @since jEdit 2.2pre6
  */
diff --git a/org/gjt/sp/jedit/EditAction.java b/org/gjt/sp/jedit/EditAction.java
index c407c73..8a550a1 100644
--- a/org/gjt/sp/jedit/EditAction.java
+++ b/org/gjt/sp/jedit/EditAction.java
@@ -1,6 +1,6 @@
 /*
  * EditAction.java - jEdit action listener
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2003 Slava Pestov
@@ -37,7 +37,7 @@ import java.awt.event.ActionListener;
  * @see ActionSet
  *
  * @author Slava Pestov
- * @version $Id: EditAction.java 20108 2011-10-18 12:16:38Z evanpw $
+ * @version $Id: EditAction.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public abstract class EditAction extends JEditAbstractEditAction<View>
 {
diff --git a/org/gjt/sp/jedit/EditBus.java b/org/gjt/sp/jedit/EditBus.java
index d988cef..fed3df4 100644
--- a/org/gjt/sp/jedit/EditBus.java
+++ b/org/gjt/sp/jedit/EditBus.java
@@ -1,6 +1,6 @@
 /*
  * EditBus.java - The EditBus
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999 Slava Pestov
@@ -80,7 +80,7 @@ import org.gjt.sp.util.ThreadUtilities;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: EditBus.java 21724 2012-05-27 14:37:27Z jarekczek $
+ * @version $Id: EditBus.java 21831 2012-06-18 22:54:17Z ezust $
  *
  * @since jEdit 2.2pre6
  */
diff --git a/org/gjt/sp/jedit/EditPane.java b/org/gjt/sp/jedit/EditPane.java
index d787a87..16b5de7 100644
--- a/org/gjt/sp/jedit/EditPane.java
+++ b/org/gjt/sp/jedit/EditPane.java
@@ -1,6 +1,6 @@
 /*
  * EditPane.java - Text area and buffer switcher
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2005 Slava Pestov
@@ -30,6 +30,8 @@ import java.awt.Graphics2D;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 import javax.swing.JPanel;
 import javax.swing.SwingUtilities;
 
@@ -39,11 +41,11 @@ import org.gjt.sp.jedit.bufferset.BufferSet;
 import org.gjt.sp.jedit.bufferset.BufferSetListener;
 import org.gjt.sp.jedit.gui.BufferSwitcher;
 import org.gjt.sp.jedit.gui.StatusBar;
-import org.gjt.sp.jedit.io.VFSManager;
 import org.gjt.sp.jedit.msg.BufferChanging;
 import org.gjt.sp.jedit.msg.BufferUpdate;
 import org.gjt.sp.jedit.msg.EditPaneUpdate;
 import org.gjt.sp.jedit.msg.PropertiesChanged;
+import org.gjt.sp.jedit.options.GeneralOptionPane;
 import org.gjt.sp.jedit.options.GutterOptionPane;
 import org.gjt.sp.jedit.syntax.SyntaxStyle;
 import org.gjt.sp.jedit.textarea.AntiAlias;
@@ -87,7 +89,7 @@ import org.gjt.sp.util.ThreadUtilities;
  * @see View#getEditPanes()
  *
  * @author Slava Pestov
- * @version $Id: EditPane.java 19592 2011-06-17 16:18:59Z kpouer $
+ * @version $Id: EditPane.java 22181 2012-09-09 23:29:58Z ezust $
  */
 public class EditPane extends JPanel implements BufferSetListener
 {
@@ -132,7 +134,7 @@ public class EditPane extends JPanel implements BufferSetListener
 	 * @param buffer The buffer to edit.
 	 * @since jEdit 2.5pre2
 	 */
-	public void setBuffer(Buffer buffer)
+	public void setBuffer(@Nonnull Buffer buffer)
 	{
 		setBuffer(buffer, true);
 	}
@@ -143,10 +145,10 @@ public class EditPane extends JPanel implements BufferSetListener
 	 * @param requestFocus true if the textarea should request focus, false otherwise
 	 * @since jEdit 4.3pre6
 	 */
-	public void setBuffer(final Buffer buffer, boolean requestFocus)
+	public void setBuffer(@Nonnull final Buffer buffer, boolean requestFocus)
 	{
 		if(buffer == null)
-			throw new NullPointerException();
+			throw new NullPointerException("The buffer cannot be null");
 
 		if(this.buffer == buffer)
 			return;
@@ -215,6 +217,11 @@ public class EditPane extends JPanel implements BufferSetListener
 					// see bug #834338
 					if(buffer == getBuffer())
 						loadCaretInfo();
+					// This must happen after loadCaretInfo.
+					// Otherwise caret is not restored properly.
+					int check = jEdit.getIntegerProperty("checkFileStatus");
+					if (jEdit.isStartupDone() && (check & GeneralOptionPane.checkFileStatus_focusBuffer) > 0);
+						jEdit.checkBufferStatus(view, true);
 				}
 			});
 		}
@@ -763,7 +770,7 @@ public class EditPane extends JPanel implements BufferSetListener
 	//{{{ Package-private members
 
 	//{{{ EditPane constructor
-	EditPane(View view, BufferSet bufferSetSource, Buffer buffer)
+	EditPane(@Nonnull View view, @Nullable BufferSet bufferSetSource, @Nonnull Buffer buffer)
 	{
 		super(new BorderLayout());
         BufferSet.Scope scope = jEdit.getBufferSetManager().getScope();
diff --git a/org/gjt/sp/jedit/EditPlugin.java b/org/gjt/sp/jedit/EditPlugin.java
index e9636da..c8b364b 100644
--- a/org/gjt/sp/jedit/EditPlugin.java
+++ b/org/gjt/sp/jedit/EditPlugin.java
@@ -1,6 +1,6 @@
 /*
  * EditPlugin.java - Abstract class all plugins must implement
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2003 Slava Pestov
@@ -26,6 +26,7 @@ import org.gjt.sp.jedit.browser.VFSBrowser;
 import org.gjt.sp.jedit.menu.EnhancedMenu;
 import org.gjt.sp.util.Log;
 
+import javax.annotation.Nullable;
 import javax.swing.*;
 import java.io.*;
 
@@ -214,7 +215,7 @@ plugin.QuickNotepadPlugin.author=John Gellene
 plugin.QuickNotepadPlugin.usePluginHome=true
 plugin.QuickNotepadPlugin.version=4.5
 plugin.QuickNotepadPlugin.docs=index.html
-
+# see jEdit.getBuild() to understand jEdit's version convention:
 plugin.QuickNotepadPlugin.depend.0=jedit 04.05.99.00
 plugin.QuickNotepadPlugin.depend.1=jdk 1.6
 plugin.QuickNotepadPlugin.description=This plugin provides a dockable "scratch pad" for writing and displaying notes, to do lists or similar items as unformatted text.
@@ -334,6 +335,7 @@ public abstract class EditPlugin
 	 * @see #getResourceAsOutputStream
 	 * @see #getResourcePath
 	 */
+	@Nullable
 	public File getPluginHome()
 	{
 		return getPluginHome(getClassName());
@@ -361,6 +363,7 @@ public abstract class EditPlugin
 	 * @see #getResourceAsOutputStream
 	 * @see #getResourcePath
 	 */
+	@Nullable
 	public static File getPluginHome(Class<? extends EditPlugin> clazz)
 	{
 		return getPluginHome(clazz.getName());
@@ -386,6 +389,7 @@ public abstract class EditPlugin
 	 * @see #getResourceAsOutputStream
 	 * @see #getResourcePath
 	 */
+	@Nullable
 	public static File getPluginHome(EditPlugin plugin)
 	{
 		return getPluginHome(plugin.getClassName());
@@ -402,6 +406,7 @@ public abstract class EditPlugin
 	 * @see #getResourceAsOutputStream
 	 * @see #getResourcePath
 	 */
+	@Nullable
 	private static File getPluginHome(String pluginClassName)
 	{
 		String settingsDirectory = jEdit.getSettingsDirectory();
@@ -668,6 +673,7 @@ public abstract class EditPlugin
 	 * @see #getResourceAsOutputStream
 	 * @see #getResourceAsStream
 	 */
+	@Nullable
 	private static File getResourcePath(String pluginClassName, String path)
 	{
 		File home = getPluginHome(pluginClassName);
diff --git a/org/gjt/sp/jedit/EditServer.java b/org/gjt/sp/jedit/EditServer.java
index 18304db..a286c57 100644
--- a/org/gjt/sp/jedit/EditServer.java
+++ b/org/gjt/sp/jedit/EditServer.java
@@ -1,6 +1,6 @@
 /*
  * EditServer.java - jEdit server
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2003 Slava Pestov
@@ -38,7 +38,8 @@ import org.gjt.sp.util.Log;
 /**
  * Inter-process communication.<p>
  *
- * The edit server protocol is very simple. <code>$HOME/.jedit/server</code>
+ * The edit server protocol is very simple.
+ * <code><i>jEditSettingsDir</i>/server</code>
  * is an ASCII file containing two lines, the first being the port number,
  * the second being the authorization key.<p>
  *
@@ -57,7 +58,7 @@ import org.gjt.sp.util.Log;
  * complicated stuff can be done too.
  *
  * @author Slava Pestov
- * @version $Id: EditServer.java 19727 2011-08-01 17:45:18Z kpouer $
+ * @version $Id: EditServer.java 22487 2012-11-18 00:59:11Z ezust $
  */
 public class EditServer extends Thread
 {
@@ -83,7 +84,7 @@ public class EditServer extends Thread
 			// Bind to any port on localhost; accept 2 simultaneous
 			// connection attempts before rejecting connections
 			socket = new ServerSocket(0, 2,
-				InetAddress.getByName("127.0.0.1"));
+				InetAddress.getByName(null));
 			authKey = new Random().nextInt(Integer.MAX_VALUE);
 			int port = socket.getLocalPort();
 
@@ -233,7 +234,7 @@ public class EditServer extends Thread
 				jEdit.newView(null,buffer);
 			}
 			else if(buffer != null)
-				view.setBuffer(buffer,false);
+				view.setBuffer(buffer);
 
 			return buffer;
 		}
diff --git a/org/gjt/sp/jedit/GUIUtilities.java b/org/gjt/sp/jedit/GUIUtilities.java
index 5628543..3447ecd 100644
--- a/org/gjt/sp/jedit/GUIUtilities.java
+++ b/org/gjt/sp/jedit/GUIUtilities.java
@@ -1,6 +1,6 @@
 /*
  * GUIUtilities.java - Various GUI utility functions
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2004 Slava Pestov
@@ -45,6 +45,7 @@ import java.util.*;
 import java.util.List;
 import java.lang.ref.SoftReference;
 
+import javax.swing.AbstractButton;
 import javax.swing.Icon;
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
@@ -87,7 +88,7 @@ import java.awt.event.*;
  * </ul>
  *
  * @author Slava Pestov
- * @version $Id: GUIUtilities.java 21469 2012-03-28 17:33:10Z ezust $
+ * @version $Id: GUIUtilities.java 21920 2012-07-03 15:35:12Z kpouer $
  */
 public class GUIUtilities
 {
@@ -294,7 +295,7 @@ public class GUIUtilities
 	public static JPopupMenu loadPopupMenu(ActionContext context, String name)
 	{
 		return loadPopupMenu(context, name, null, null);
-	}
+	} //}}}
 
 	//{{{ loadPopupMenu() method
 	/**
@@ -341,6 +342,7 @@ public class GUIUtilities
 
 		return menu;
 	} //}}}
+
 	//{{{ addServiceContextMenuItems() method
 	/**
 	 * @return a list of menu items defined by services.
@@ -611,7 +613,33 @@ public class GUIUtilities
 		}
 	} //}}}
 
-	//}}}
+	//{{{ setAutoMnemonic() method
+	/**
+	 * Sets the mnemonic for the given button using jEdit convention,
+	 * taking the letter after the dollar.
+	 * @param button The button to set the mnemonic for.
+	 * @since jEdit 5.1
+	 */
+	public static void setAutoMnemonic(AbstractButton button)
+	{
+		String label = button.getText();
+		char mnemonic;
+		int index = label.indexOf('$');
+		if (index != -1 && label.length() - index > 1)
+		{
+			mnemonic = Character.toLowerCase(label.charAt(index + 1));
+			label = label.substring(0, index).concat(label.substring(++index));
+		}
+		else
+		{
+			mnemonic = '\0';
+		}
+		if (mnemonic != '\0')
+		{
+			button.setMnemonic(mnemonic);
+			button.setText(label);
+		}
+	} //}}}
 
 	//}}}
 
@@ -2120,7 +2148,7 @@ public class GUIUtilities
 	 * For non-Frame's use {@link GUIUtilities#saveGeometry(Window,String)}
 	 *
 	 * @author Björn Kautler
-	 * @version $Id: GUIUtilities.java 21469 2012-03-28 17:33:10Z ezust $
+	 * @version $Id: GUIUtilities.java 21920 2012-07-03 15:35:12Z kpouer $
 	 * @since jEdit 4.3pre6
 	 * @see GUIUtilities#saveGeometry(Window,Container,String)
 	 */
diff --git a/org/gjt/sp/jedit/IPropertyManager.java b/org/gjt/sp/jedit/IPropertyManager.java
index 693850e..5655369 100644
--- a/org/gjt/sp/jedit/IPropertyManager.java
+++ b/org/gjt/sp/jedit/IPropertyManager.java
@@ -1,6 +1,6 @@
 /*
  * IPropertyManager.java - An interface for class that returns properties
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/JARClassLoader.java b/org/gjt/sp/jedit/JARClassLoader.java
index 35c784e..5d122d0 100644
--- a/org/gjt/sp/jedit/JARClassLoader.java
+++ b/org/gjt/sp/jedit/JARClassLoader.java
@@ -1,6 +1,6 @@
 /*
  * JARClassLoader.java - Loads classes from JAR files
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2003 Slava Pestov
@@ -43,7 +43,7 @@ import java.util.jar.Attributes.Name;
  * A class loader implementation that loads classes from JAR files. All
  * instances share the same set of classes.
  * @author Slava Pestov
- * @version $Id: JARClassLoader.java 18919 2010-11-04 10:52:55Z kpouer $
+ * @version $Id: JARClassLoader.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class JARClassLoader extends ClassLoader
 {
diff --git a/org/gjt/sp/jedit/JEditAbstractEditAction.java b/org/gjt/sp/jedit/JEditAbstractEditAction.java
index d62185d..078f54a 100644
--- a/org/gjt/sp/jedit/JEditAbstractEditAction.java
+++ b/org/gjt/sp/jedit/JEditAbstractEditAction.java
@@ -1,6 +1,6 @@
 /*
  * AbstractEditAction.java - Base class for EditAction
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
   * This program is free software; you can redistribute it and/or
diff --git a/org/gjt/sp/jedit/JEditActionContext.java b/org/gjt/sp/jedit/JEditActionContext.java
index d870643..938b48e 100644
--- a/org/gjt/sp/jedit/JEditActionContext.java
+++ b/org/gjt/sp/jedit/JEditActionContext.java
@@ -1,6 +1,6 @@
 /*
  * JEditActionContext.java - For code sharing between jEdit and VFSBrowser
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/JEditActionSet.java b/org/gjt/sp/jedit/JEditActionSet.java
index d74cd43..a6719b3 100644
--- a/org/gjt/sp/jedit/JEditActionSet.java
+++ b/org/gjt/sp/jedit/JEditActionSet.java
@@ -1,6 +1,6 @@
 /*
  * JEditActionSet.java - A set of actions
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2003 Slava Pestov
@@ -380,7 +380,18 @@ public abstract class JEditActionSet<E extends JEditAbstractEditAction> implemen
 		{
 			Log.log(Log.DEBUG,this,"Loading actions from " + uri);
 			ActionListHandler ah = new ActionListHandler(uri.toString(),this);
-			if ( XMLUtilities.parseXML(uri.openStream(), ah))
+			InputStream in = uri.openStream();
+			if(in == null)
+			{
+				// this happened when calling generateCache() in the context of 'find orphan jars'
+				// in org.gjt.sp.jedit.pluginmgr.ManagePanel.FindOrphan.actionPerformed(ActionEvent)
+				// because for not loaded plugins, the plugin will not be added to the list of pluginJars
+				// so the org.gjt.sp.jedit.proto.jeditresource.PluginResURLConnection will not find the plugin
+				// to read the resource from.
+				// Better log a small error message than a big stack trace
+				Log.log(Log.WARNING, this, "Unable to open: " + uri);
+			}
+			else if ( XMLUtilities.parseXML(in, ah))
 			{
 				Log.log(Log.ERROR, this, "Unable to parse: " + uri);
 			}
diff --git a/org/gjt/sp/jedit/JEditBeanShellAction.java b/org/gjt/sp/jedit/JEditBeanShellAction.java
index e5e2d21..a245819 100644
--- a/org/gjt/sp/jedit/JEditBeanShellAction.java
+++ b/org/gjt/sp/jedit/JEditBeanShellAction.java
@@ -1,6 +1,6 @@
 /*
  * JEditBeanShellAction.java - jEdit BeanShell action
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/JEditKillRing.java b/org/gjt/sp/jedit/JEditKillRing.java
index 53d87b5..9e242bb 100644
--- a/org/gjt/sp/jedit/JEditKillRing.java
+++ b/org/gjt/sp/jedit/JEditKillRing.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003, 2005 Slava Pestov
@@ -21,6 +21,7 @@
  */
 package org.gjt.sp.jedit;
 
+import java.io.Closeable;
 import java.io.File;
 import java.util.List;
 import java.util.LinkedList;
@@ -151,7 +152,7 @@ class JEditKillRing extends KillRing
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(out);
+			IOUtilities.closeQuietly((Closeable)out);
 		}
 	} //}}}
 
diff --git a/org/gjt/sp/jedit/JEditMode.java b/org/gjt/sp/jedit/JEditMode.java
index f35fbf4..1a352dd 100644
--- a/org/gjt/sp/jedit/JEditMode.java
+++ b/org/gjt/sp/jedit/JEditMode.java
@@ -1,6 +1,6 @@
 /*
  * JEditMode.java - jEdit editing mode
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Matthieu Casanova
@@ -80,10 +80,10 @@ class JEditMode extends Mode
 	@Override
 	public Object getProperty(String key)
 	{
-		String prefix = "mode." + name + '.';
 
 		//if(jEdit.getBooleanProperty(prefix + "customSettings"))
 		//{
+			String prefix = "mode." + name + '.';
 			String property = jEdit.getProperty(prefix + key);
 			if(property != null)
 			{
@@ -148,6 +148,5 @@ class JEditMode extends Mode
 		}
 	} //}}}
 
-
-	private boolean initialized = false;
+	private boolean initialized;
 }
diff --git a/org/gjt/sp/jedit/JEditRegisterSaver.java b/org/gjt/sp/jedit/JEditRegisterSaver.java
index 4b42faf..7dc72bb 100644
--- a/org/gjt/sp/jedit/JEditRegisterSaver.java
+++ b/org/gjt/sp/jedit/JEditRegisterSaver.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
@@ -20,6 +20,8 @@
  */
 package org.gjt.sp.jedit;
 
+import java.io.Closeable;
+
 import org.gjt.sp.util.Log;
 import org.gjt.sp.util.XMLUtilities;
 import org.gjt.sp.util.IOUtilities;
@@ -137,7 +139,7 @@ class JEditRegisterSaver implements RegisterSaver
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(out);
+			IOUtilities.closeQuietly((Closeable)out);
 		}
 	} //}}}
 
diff --git a/org/gjt/sp/jedit/JEditRegistersListener.java b/org/gjt/sp/jedit/JEditRegistersListener.java
index fe62e21..09f8606 100644
--- a/org/gjt/sp/jedit/JEditRegistersListener.java
+++ b/org/gjt/sp/jedit/JEditRegistersListener.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/Macros.java b/org/gjt/sp/jedit/Macros.java
index a4dd690..5dc12c7 100644
--- a/org/gjt/sp/jedit/Macros.java
+++ b/org/gjt/sp/jedit/Macros.java
@@ -1,6 +1,6 @@
 /*
  * Macros.java - Macro manager
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2004 Slava Pestov
@@ -58,7 +58,7 @@ import java.util.regex.Pattern;
  * the methods in the {@link GUIUtilities} class instead.
  *
  * @author Slava Pestov
- * @version $Id: Macros.java 20414 2011-11-23 17:48:45Z daleanson $
+ * @version $Id: Macros.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class Macros
 {
diff --git a/org/gjt/sp/jedit/Marker.java b/org/gjt/sp/jedit/Marker.java
index 4af721a..ec5da4a 100644
--- a/org/gjt/sp/jedit/Marker.java
+++ b/org/gjt/sp/jedit/Marker.java
@@ -1,6 +1,6 @@
 /*
  * Marker.java - Named location in a buffer
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 1999, 2000, 2001 Slava Pestov
@@ -36,7 +36,7 @@ import javax.swing.text.Position;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: Marker.java 21778 2012-06-10 01:15:15Z k_satoda $
+ * @version $Id: Marker.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class Marker
 {
diff --git a/org/gjt/sp/jedit/MiscUtilities.java b/org/gjt/sp/jedit/MiscUtilities.java
index 5a9d1ef..1037fcd 100644
--- a/org/gjt/sp/jedit/MiscUtilities.java
+++ b/org/gjt/sp/jedit/MiscUtilities.java
@@ -3,10 +3,10 @@
  * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
- * Copyright (C) 1999, 2005 Slava Pestov
- * Portions copyright (C) 2000 Richard S. Hall
- * Portions copyright (C) 2001 Dirk Moebius
- * Portions copyright (c) 2005-2012 by the jEdit All-Volunteer Development Team (tm)
+ * Copyright © 1999-2013 Slava Pestov, Richard S. Hall, Dirk Moebius,
+ *    jgellene, ezust, vanza, kpouer, Vampire0, Jarekczek, k_satoda, voituk,
+ *    Thomas Meyer, Martin Raspe
+ *   And possibly other members of the All Volunteer Developer Team (tm)
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -46,7 +46,7 @@ import org.gjt.sp.util.StringList;
 //}}}
 
 /**
- * Path name manipulation, string manipulation, and more.<p>
+ * Path, URL name manipulation, string manipulation, and more.<p>
  *
  * The most frequently used members of this class are:<p>
  *
@@ -57,9 +57,7 @@ import org.gjt.sp.util.StringList;
  * <li>{@link #constructPath(String,String)}</li>
  * </ul>
  *
- * @author Slava Pestov
- * @author John Gellene (API documentation)
- * @version $Id: MiscUtilities.java 22457 2012-11-11 17:16:21Z ezust $
+ * @version $Id: MiscUtilities.java 22828 2013-03-05 19:40:05Z ezust $
  */
 public class MiscUtilities
 {
@@ -130,6 +128,7 @@ public class MiscUtilities
 
 	/** Accepts a string from the user which may contain variables of various syntaxes.
 	 *  The function supports the following expansion syntaxes:
+	 *     ~/ or ~\   expand to user.home
 	 *     $varname
 	 *     ${varname} (on non-windows)
 	 *     %varname% (on Windows)
@@ -172,7 +171,7 @@ public class MiscUtilities
 		return arg;
 	} //}}}
 
-	//{{{ abbreviate() method
+	//{{{ abbreviate() methods
 	/** @return an abbreviated path, replacing values with variables, if a prefix exists.
 		uses platform convention (%varname% on windows, $varname on other platforms)
 	 *  @see #expandVariables
@@ -183,6 +182,16 @@ public class MiscUtilities
 		if (svc == null)
 			svc = new VarCompressor();
 		return svc.compress(path);
+	}
+	
+	/** Same as abbreviate() but checks a view option which can 
+	 * disable the feature for things jEdit UI components.
+	 * 
+	 */
+	public static String abbreviateView(String path)
+	{
+		if (!jEdit.getBooleanProperty("view.abbreviatePaths")) return path;
+		return abbreviate(path);		
 	} //}}}
 
 	//{{{ resolveSymlinks() method
@@ -197,6 +206,9 @@ public class MiscUtilities
 		if(isURL(path))
 			return path;
 
+		// 2 aug 2003: OS/2 Java has a broken getCanonicalPath()
+		if(OperatingSystem.isOS2())
+			return path;
 		// 18 nov 2003: calling this on a drive letter on Windows causes
 		// drive access
 		if(OperatingSystem.isWindows())
@@ -578,13 +590,13 @@ public class MiscUtilities
 		Uses native desktop commands for each platform, which ask the user to choose an
 		association for files that do not already have one, using the desktop's
 		dialog, in contrast to Desktop.open() which just throws an IOException
-		for unknown types. 
-		
-		@param path path or URL (supported on Linux, anyway) of thing to open  
+		for unknown types.
+
+		@param path path or URL (supported on Linux, anyway) of thing to open
 		@author Alan Ezust
 		@since jEdit 5.0
 	*/
-	public static void openInDesktop(String path) 
+	public static void openInDesktop(String path)
 	{
 		StringList sl = new StringList();
 		if (OperatingSystem.isWindows())
@@ -595,20 +607,28 @@ public class MiscUtilities
 		else if (OperatingSystem.isMacOS())
 			sl.add("open");
 		else if (OperatingSystem.isX11())
+		{
+			/* For gnome, use gnome-open. Need a way of testing that gnome is actually
+			   running though. Otherwise it is not the correct program to use. 
+			File f = new File("/usr/bin/gnome-open");
+			if (f.exists()) sl.add("gnome-open");
+			else */ 
 			sl.add("xdg-open");
-		try 
-		{		
+		}
+		try
+		{
 			if (sl.isEmpty()) // I don't know what platform it is
 				java.awt.Desktop.getDesktop().open(new File(path));
-			else 
+			else
 			{
 				sl.add(path);
+				Log.log(Log.DEBUG, MiscUtilities.class, "openInDesktop: " + sl.join(" "));
 				Runtime.getRuntime().exec(sl.toArray());
 			}
 		}
-		catch (IOException ioe) 
+		catch (IOException ioe)
 		{
-			Log.log(Log.ERROR, MiscUtilities.class, "openInDesktop failed: " + path, ioe);	
+			Log.log(Log.ERROR, MiscUtilities.class, "openInDesktop failed: " + path, ioe);
 		}
 	}// }}}
 
@@ -672,7 +692,7 @@ public class MiscUtilities
 	 * <code>backup.minTime</code> (property) ms ago.
 	 * Uses jedit properties to determine backup parameters,
 	 * like prefix, suffix.
-	 * @param file The file to back up.
+	 * @param path The file to back up.
 	 * @param backupDir The directory, usually obtained from
 	 *                  <code>prepareBackupDirectory</code>.
 	 * @return File suitable for backup of <code>file</code>,
@@ -698,7 +718,7 @@ public class MiscUtilities
 	 * In case of multiple backups does necessary backup renumbering.
 	 * Checks whether the last backup was not earlier than
 	 * <code>backupTimeDistance</code> ms ago.
-	 * @param file The file to back up.
+	 * @param path The file to back up.
 	 * @param backups The number of backups. Must be >= 1. If > 1, backup
 	 * files will be numbered.
 	 * @param backupDirectory The directory determined externally or
diff --git a/org/gjt/sp/jedit/Mode.java b/org/gjt/sp/jedit/Mode.java
index 1badd3c..6e5b868 100644
--- a/org/gjt/sp/jedit/Mode.java
+++ b/org/gjt/sp/jedit/Mode.java
@@ -1,6 +1,6 @@
 /*
  * Mode.java - jEdit editing mode
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 1999, 2000 Slava Pestov
@@ -30,6 +30,7 @@ import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 import org.gjt.sp.jedit.indent.DeepIndentRule;
@@ -47,7 +48,7 @@ import org.gjt.sp.util.StandardUtilities;
  * One instance of this class is created for each supported edit mode.
  *
  * @author Slava Pestov
- * @version $Id: Mode.java 21723 2012-05-27 14:34:13Z k_satoda $
+ * @version $Id: Mode.java 22949 2013-04-23 18:53:15Z thomasmey $
  */
 public class Mode
 {
@@ -75,7 +76,7 @@ public class Mode
 	{
 		try
 		{
-			filepathRE = null;
+			filepathMatcher = null;
 			String filenameGlob = (String)getProperty("filenameGlob");
 			if(filenameGlob != null && !filenameGlob.isEmpty())
 			{
@@ -93,15 +94,15 @@ public class Mode
 					// an optional path prefix to be able to match against full paths
 					filepathRE = String.format("(?:.*[/\\\\])?%s", filepathRE);
 				}
-				this.filepathRE = Pattern.compile(filepathRE, Pattern.CASE_INSENSITIVE);
+				this.filepathMatcher = Pattern.compile(filepathRE, Pattern.CASE_INSENSITIVE).matcher("");
 			}
 
-			firstlineRE = null;
+			firstlineMatcher = null;
 			String firstlineGlob = (String)getProperty("firstlineGlob");
 			if(firstlineGlob != null && !firstlineGlob.isEmpty())
 			{
-				firstlineRE = Pattern.compile(StandardUtilities.globToRE(firstlineGlob),
-							      Pattern.CASE_INSENSITIVE);
+				firstlineMatcher = Pattern.compile(StandardUtilities.globToRE(firstlineGlob),
+								Pattern.CASE_INSENSITIVE).matcher("");
 			}
 		}
 		catch(PatternSyntaxException re)
@@ -164,10 +165,7 @@ public class Mode
 	 */
 	public Object getProperty(String key)
 	{
-		Object value = props.get(key);
-		if(value != null)
-			return value;
-		return null;
+		return props.get(key);
 	} //}}}
 
 	//{{{ getBooleanProperty() method
@@ -213,24 +211,12 @@ public class Mode
 	public void setProperties(Map props)
 	{
 		if(props == null)
-			props = new Hashtable<String, Object>();
+			return;
 
 		ignoreWhitespace = !"false".equalsIgnoreCase(
 					(String)props.get("ignoreWhitespace"));
 
-		// need to carry over file name and first line globs because they are
-		// not given to us by the XMode handler, but instead are filled in by
-		// the catalog loader.
-		String filenameGlob = (String)this.props.get("filenameGlob");
-		String firstlineGlob = (String)this.props.get("firstlineGlob");
-		String filename = (String)this.props.get("file");
-		this.props = props;
-		if(filenameGlob != null)
-			props.put("filenameGlob",filenameGlob);
-		if(firstlineGlob != null)
-			props.put("firstlineGlob",firstlineGlob);
-		if(filename != null)
-			props.put("file",filename);
+		this.props.putAll(props);
 	} //}}}
 
 	//{{{ accept() method
@@ -261,9 +247,9 @@ public class Mode
 	 */
 	public boolean accept(String filePath, String fileName, String firstLine)
 	{
-		return acceptIdentical(filePath, fileName)
-		       || acceptFile(filePath, fileName)
-		       || acceptFirstLine(firstLine);
+		return acceptFile(filePath, fileName)
+				|| acceptIdentical(filePath, fileName)
+				|| acceptFirstLine(firstLine);
 	} //}}}
 
 	//{{{ acceptFilename() method
@@ -290,9 +276,11 @@ public class Mode
 	 */
 	public boolean acceptFile(String filePath, String fileName)
 	{
-		return filepathRE != null
-		       && (((filePath != null) && filepathRE.matcher(filePath).matches())
-			   || ((fileName != null) && filepathRE.matcher(fileName).matches()));
+		if (filepathMatcher == null)
+			return false;
+
+		return fileName != null && filepathMatcher.reset(fileName).matches() ||
+			filePath != null && filepathMatcher.reset(filePath).matches();
 	} //}}}
 
 	//{{{ acceptFilenameIdentical() method
@@ -321,10 +309,26 @@ public class Mode
 	 */
 	public boolean acceptIdentical(String filePath, String fileName)
 	{
-		return ((filePath != null) && filePath.equals(getProperty("filenameGlob"))
-		        && (filepathRE == null || filepathRE.matcher(filePath).matches()))
-		       || ((fileName != null) && fileName.equals(getProperty("filenameGlob"))
-		           && (filepathRE == null || filepathRE.matcher(fileName).matches()));
+		String filenameGlob = (String)getProperty("filenameGlob");
+		if(filenameGlob == null)
+			return false;
+
+		if(fileName != null && fileName.equalsIgnoreCase(filenameGlob))	
+			return true;
+
+		if (filePath != null) 
+		{
+			// get the filename from the path
+			// NOTE: can't use MiscUtilities.getFileName here as that breaks
+			// the stand-alone text area build.
+			int lastUnixPos = filePath.lastIndexOf('/');
+			int lastWindowsPos = filePath.lastIndexOf('\\');
+			int index = Math.max(lastUnixPos, lastWindowsPos);
+			String filename = filePath.substring(index + 1);
+			return filename != null && filename.equalsIgnoreCase(filenameGlob);
+		}
+
+		return false;
 	} //}}}
 
 	//{{{ acceptFirstLine() method
@@ -336,7 +340,10 @@ public class Mode
 	 */
 	public boolean acceptFirstLine(String firstLine)
 	{
-		return firstlineRE != null && firstlineRE.matcher(firstLine).matches();
+		if (firstlineMatcher == null)
+			return false;
+
+		return firstLine != null && firstlineMatcher.reset(firstLine).matches();
 	} //}}}
 
 	//{{{ getName() method
@@ -517,10 +524,10 @@ public class Mode
 	//}}}
 
 	//{{{ Private members
-	protected String name;
-	protected Map<String, Object> props;
-	private Pattern firstlineRE;
-	private Pattern filepathRE;
+	protected final String name;
+	protected final Map<String, Object> props;
+	private Matcher firstlineMatcher;
+	private Matcher filepathMatcher;
 	protected TokenMarker marker;
 	private List<IndentRule> indentRules;
 	private String electricKeys;
diff --git a/org/gjt/sp/jedit/ModeCatalogHandler.java b/org/gjt/sp/jedit/ModeCatalogHandler.java
index a734cdc..b95c587 100644
--- a/org/gjt/sp/jedit/ModeCatalogHandler.java
+++ b/org/gjt/sp/jedit/ModeCatalogHandler.java
@@ -65,14 +65,10 @@ class ModeCatalogHandler extends DefaultHandler
 			String filenameGlob = attrs.getValue("FILE_NAME_GLOB");
 			String firstlineGlob = attrs.getValue("FIRST_LINE_GLOB");
 
+			Mode mode = instantiateMode(modeName);
 
-			Mode mode = ModeProvider.instance.getMode(modeName);
-			if (mode == null)
-			{
-			    mode = instantiateMode(modeName);
-			}
 			ModeProvider.instance.addMode(mode);
-			
+
 			Object path;
 			if(resource)
 				path = jEdit.class.getResource(directory + file);
@@ -82,12 +78,12 @@ class ModeCatalogHandler extends DefaultHandler
 
 			mode.unsetProperty("filenameGlob");
 			if(filenameGlob != null)
-			    mode.setProperty("filenameGlob",filenameGlob);
-			    
+				mode.setProperty("filenameGlob",filenameGlob);
+
 			mode.unsetProperty("firstlineGlob");
 			if(firstlineGlob != null)
-			    mode.setProperty("firstlineGlob",firstlineGlob);
-			    
+				mode.setProperty("firstlineGlob",firstlineGlob);
+
 			mode.init();
 		}
 	} //}}}
diff --git a/org/gjt/sp/jedit/OperatingSystem.java b/org/gjt/sp/jedit/OperatingSystem.java
index d72c9f3..bee1849 100644
--- a/org/gjt/sp/jedit/OperatingSystem.java
+++ b/org/gjt/sp/jedit/OperatingSystem.java
@@ -1,6 +1,6 @@
 /*
  * OperatingSystem.java - OS detection
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002, 2005 Slava Pestov
@@ -37,7 +37,7 @@ import org.gjt.sp.util.Log;
 /**
  * Operating system detection routines.
  * @author Slava Pestov
- * @version $Id: OperatingSystem.java 20631 2011-12-12 23:35:36Z kpouer $
+ * @version $Id: OperatingSystem.java 22935 2013-04-17 17:24:33Z ezust $
  * @since jEdit 4.0pre4
  */
 public class OperatingSystem
@@ -152,13 +152,13 @@ public class OperatingSystem
 
 	//{{{ isDOSDerived() method
 	/**
-	 * Returns if we're running Windows 95/98/ME/NT/2000/XP/Vista/Win7.
+	 * Returns if we're running Windows 95/98/ME/NT/2000/XP/Vista/Win7, or OS/2.
 	 * @deprecated use {@link #isWindows()}
 	 */
 	@Deprecated
 	public static boolean isDOSDerived()
 	{
-		return isWindows();
+		return isWindows() || isOS2();
 	} //}}}
 
 	//{{{ isWindows() method
@@ -188,6 +188,15 @@ public class OperatingSystem
 		return os == WINDOWS_NT;
 	} //}}}
 
+	//{{{ isOS2() method
+	/**
+	 * Returns if we're running OS/2.
+	 */
+	public static boolean isOS2()
+	{
+		return os == OS2;
+	} //}}}
+
 	//{{{ isUnix() method
 	/**
 	 * Returns if we're running Unix (this includes MacOS X).
@@ -291,6 +300,7 @@ public class OperatingSystem
 	private static final int UNIX = 0x31337;
 	private static final int WINDOWS_9x = 0x640;
 	private static final int WINDOWS_NT = 0x666;
+	private static final int OS2 = 0xDEAD;
 	private static final int MAC_OS_X = 0xABC;
 	private static final int VMS = 0xDEAD2;
 	private static final int UNKNOWN = 0xBAD;
@@ -302,38 +312,38 @@ public class OperatingSystem
 	//{{{ Class initializer
 	static
 	{
-		if(System.getProperty("mrj.version") != null)
+		String osName = System.getProperty("os.name");
+		if(osName.contains("Windows 9")
+			|| osName.contains("Windows M"))
+		{
+			os = WINDOWS_9x;
+		}
+		else if(osName.contains("Windows"))
+		{
+			os = WINDOWS_NT;
+		}
+		else if(osName.contains("VMS"))
+		{
+			os = VMS;
+		}
+		else if(osName.contains("OS X"))
 		{
 			os = MAC_OS_X;
 		}
+		else if(File.separatorChar == '/')
+		{
+			os = UNIX;
+		}
+		else if(osName.contains("OS/2"))
+		{
+			os = OS2;
+		}
 		else
 		{
-			String osName = System.getProperty("os.name");
-			if(osName.contains("Windows 9")
-				|| osName.contains("Windows M"))
-			{
-				os = WINDOWS_9x;
-			}
-			else if(osName.contains("Windows"))
-			{
-				os = WINDOWS_NT;
-			}
-			else if(osName.contains("VMS"))
-			{
-				os = VMS;
-			}
-			else if(File.separatorChar == '/')
-			{
-				os = UNIX;
-			}
-			else
-			{
-				os = UNKNOWN;
-				Log.log(Log.WARNING,OperatingSystem.class,
-					"Unknown operating system: " + osName);
-			}
+			os = UNKNOWN;
+			Log.log(Log.WARNING,OperatingSystem.class,
+			"Unknown operating system: " + osName);
 		}
-
 		// for debugging, make jEdit think its using a different
 		// version of Java than it really is.
 		String javaVersion = System.getProperty("jedit.force.java.version");
diff --git a/org/gjt/sp/jedit/OptionGroup.java b/org/gjt/sp/jedit/OptionGroup.java
index cd30a38..2b03304 100644
--- a/org/gjt/sp/jedit/OptionGroup.java
+++ b/org/gjt/sp/jedit/OptionGroup.java
@@ -1,6 +1,6 @@
 /*
  * OptionGroup.java - Option pane group
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000 mike dillon
@@ -33,7 +33,7 @@ import java.util.*;
  * option pane instances.
  *
  * @author Mike Dillon
- * @version $Id: OptionGroup.java 14444 2009-01-24 06:19:57Z shlomy $
+ * @version $Id: OptionGroup.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class OptionGroup
 {
diff --git a/org/gjt/sp/jedit/PerspectiveManager.java b/org/gjt/sp/jedit/PerspectiveManager.java
index 4cfebbd..267f300 100644
--- a/org/gjt/sp/jedit/PerspectiveManager.java
+++ b/org/gjt/sp/jedit/PerspectiveManager.java
@@ -1,6 +1,6 @@
 /*
  * PerspectiveManager.java - Saves view configuration
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -22,6 +22,7 @@
 
 package org.gjt.sp.jedit;
 
+import java.io.Closeable;
 import java.io.StreamTokenizer;
 import java.io.StringReader;
 import java.io.IOException;
@@ -39,7 +40,7 @@ import org.xml.sax.helpers.DefaultHandler;
 /** Manages persistence of open buffers and views across jEdit sessions.
  * @since jEdit 4.2pre1
  * @author Slava Pestov
- * @version $Id: PerspectiveManager.java 21398 2012-03-20 04:32:13Z ezust $
+ * @version $Id: PerspectiveManager.java 22357 2012-10-13 04:58:01Z ezust $
  */
 public class PerspectiveManager
 {
@@ -120,7 +121,7 @@ public class PerspectiveManager
 
 		if(perspectiveXML == null)
 			return;
-		
+
 		// backgrounded
 		if(jEdit.getBufferCount() == 0)
 			return;
@@ -185,7 +186,7 @@ public class PerspectiveManager
 				out.write(config.plainView ? "TRUE" : "FALSE");
 				out.write("\">");
 				out.write(lineSep);
-				
+
 				if (config.title != null)
 				{
 					out.write(lineSep);
@@ -218,7 +219,7 @@ public class PerspectiveManager
 
 				if (config.docking != null)
 					config.docking.saveLayout(PERSPECTIVE_FILENAME, i);
-				
+
 				out.write("</VIEW>");
 				out.write(lineSep);
 			}
@@ -235,7 +236,7 @@ public class PerspectiveManager
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(out);
+			IOUtilities.closeQuietly((Closeable)out);
 		}
 	} //}}}
 
@@ -263,7 +264,7 @@ public class PerspectiveManager
 		boolean restoreFiles;
 		boolean restoreSplits;
 		String autoReload, autoReloadDialog;
-		
+
 		PerspectiveHandler(boolean restoreFiles)
 		{
 			this.restoreFiles = restoreFiles;
@@ -372,7 +373,7 @@ public class PerspectiveManager
 		{
 			charData.append(ch,start,length);
 		}
-		
+
 	}
 	//}}}
 }
diff --git a/org/gjt/sp/jedit/PluginJAR.java b/org/gjt/sp/jedit/PluginJAR.java
index 5e0a50c..e9b3cff 100644
--- a/org/gjt/sp/jedit/PluginJAR.java
+++ b/org/gjt/sp/jedit/PluginJAR.java
@@ -1,6 +1,6 @@
 /*
  * PluginJAR.java - Controls JAR loading and unloading
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2004 Slava Pestov
@@ -26,6 +26,7 @@ package org.gjt.sp.jedit;
 import java.awt.EventQueue;
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
+import java.io.Closeable;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.File;
@@ -141,7 +142,7 @@ import static org.gjt.sp.jedit.EditBus.EBHandler;
  * @see ServiceManager
  *
  * @author Slava Pestov
- * @version $Id: PluginJAR.java 22145 2012-09-03 14:46:14Z kpouer $
+ * @version $Id: PluginJAR.java 22920 2013-04-06 15:03:55Z kerik-sf $
  * @since jEdit 4.2pre1
  */
 public class PluginJAR
@@ -1000,7 +1001,7 @@ public class PluginJAR
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(din);
+			IOUtilities.closeQuietly((Closeable)din);
 		}
 	} //}}}
 
@@ -1025,7 +1026,7 @@ public class PluginJAR
 		catch(IOException io)
 		{
 			Log.log(Log.ERROR,PluginJAR.class,io);
-			IOUtilities.closeQuietly(dout);
+			IOUtilities.closeQuietly((Closeable)dout);
 			new File(jarCachePath).delete();
 		}
 	} //}}}
@@ -1130,7 +1131,7 @@ public class PluginJAR
 				Collection<Properties> values = localizationProperties.values();
 				for (Properties value : values)
 				{
-					jEdit.removePluginProps(value);
+					jEdit.removePluginLocalizationProps(value);
 				}
 			}
 			try
@@ -1204,7 +1205,7 @@ public class PluginJAR
 			Properties langProperties = localizationProperties.get(currentLanguage);
 			if (langProperties != null)
 			{
-				jEdit.addPluginProps(langProperties);
+				jEdit.addPluginLocalizationProps(langProperties);
 			}
 		}
 
@@ -1340,7 +1341,7 @@ public class PluginJAR
 				}
 				finally
 				{
-					IOUtilities.closeQuietly(in);
+					IOUtilities.closeQuietly((Closeable)in);
 				}
 			}
 			else if(name.endsWith(".class"))
@@ -1371,7 +1372,7 @@ public class PluginJAR
 					}
 					finally
 					{
-						IOUtilities.closeQuietly(in);
+						IOUtilities.closeQuietly((Closeable)in);
 					}
 				}
 				else
@@ -1390,7 +1391,7 @@ public class PluginJAR
 			Properties langProperties = localizationProperties.get(currentLanguage);
 			if (langProperties != null)
 			{
-				jEdit.addPluginProps(langProperties);
+				jEdit.addPluginLocalizationProps(langProperties);
 			}
 		}
 
@@ -1444,6 +1445,14 @@ public class PluginJAR
 			}
 		}
 
+		boolean isBeingLoaded = jEdit.getPluginJAR(getPath()) != null;
+		if(!isBeingLoaded)
+		{
+			Log.log(Log.DEBUG, PluginJAR.class,
+					"not loading actions, dockables, services "
+					+"because the plugin is not really being loaded");
+			return cache;
+		}
 		if(cache.actionsURI != null)
 		{
 			actions = new ActionSet(this,null,null,
@@ -1506,7 +1515,7 @@ public class PluginJAR
 
 		return cache;
 	} //}}}
-	
+
 	private static boolean continueLoading(String clazz, Properties cachedProperties)
 	{
 		if(jEdit.getPlugin(clazz) != null)
@@ -1700,7 +1709,7 @@ public class PluginJAR
 
 			cachedProperties = readMap(din);
 			localizationProperties = readLanguagesMap(din);
-			
+
 			pluginClass = readString(din);
 
 			return true;
@@ -1829,8 +1838,8 @@ public class PluginJAR
 			int languagesCount = din.readInt();
 			if (languagesCount == 0)
 				return Collections.emptyMap();
-			
-			
+
+
 			Map<String, Properties> languages = new HashMap<String, Properties>(languagesCount);
 			for (int i = 0;i<languagesCount;i++)
 			{
diff --git a/org/gjt/sp/jedit/PropertyManager.java b/org/gjt/sp/jedit/PropertyManager.java
index 75c6cc5..a4193f6 100644
--- a/org/gjt/sp/jedit/PropertyManager.java
+++ b/org/gjt/sp/jedit/PropertyManager.java
@@ -1,6 +1,6 @@
 /*
  * PropertyManager.java - Manages property files
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2004 Slava Pestov
@@ -36,17 +36,13 @@ class PropertyManager
 			total.putAll(plugin);
 		total.putAll(site);
 		total.putAll(localization);
+		for (Properties pluginLocalization : pluginLocalizations)
+			total.putAll(pluginLocalization);
 		total.putAll(user);
 		return total;
 	} //}}}
 
-	//{{{ loadSystemProps() methods
-	void loadSystemProps(InputStream in)
-		throws IOException
-	{
-		loadProps(system,in);
-	}
-
+	//{{{ loadSystemProps() method
 	void loadSystemProps(Reader in)
 		throws IOException
 	{
@@ -106,6 +102,28 @@ class PropertyManager
 		plugins.remove(props);
 	} //}}}
 
+	//{{{ loadPluginLocalizationProps() method
+	Properties loadPluginLocalizationProps(Reader in)
+		throws IOException
+	{
+		Properties pluginLocalization = new Properties();
+		loadProps(pluginLocalization,in);
+		pluginLocalizations.add(pluginLocalization);
+		return pluginLocalization;
+	} //}}}
+
+	//{{{ addPluginLocalizationProps() method
+	void addPluginLocalizationProps(Properties props)
+	{
+		pluginLocalizations.add(props);
+	} //}}}
+
+	//{{{ removePluginLocalizationProps() method
+	void removePluginLocalizationProps(Properties props)
+	{
+		pluginLocalizations.remove(props);
+	} //}}}
+
 	//{{{ getProperty() method
 	String getProperty(String name)
 	{
@@ -113,6 +131,13 @@ class PropertyManager
 		if(value != null)
 			return value;
 
+		for (Properties pluginLocalization : pluginLocalizations)
+		{
+			value = pluginLocalization.getProperty(name);
+			if (value != null)
+				return value;
+		}
+
 		value = localization.getProperty(name);
 		if (value != null)
 			return value;
@@ -175,6 +200,7 @@ class PropertyManager
 	private final List<Properties> plugins = new LinkedList<Properties>();
 	private final Properties site = new Properties();
 	private final Properties localization = new Properties();
+	private final List<Properties> pluginLocalizations = new LinkedList<Properties>();
 	private final Properties user = new Properties();
 
 	//{{{ getDefaultProperty() method
diff --git a/org/gjt/sp/jedit/RegisterSaver.java b/org/gjt/sp/jedit/RegisterSaver.java
index 63a7897..a15e6b1 100644
--- a/org/gjt/sp/jedit/RegisterSaver.java
+++ b/org/gjt/sp/jedit/RegisterSaver.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/Registers.java b/org/gjt/sp/jedit/Registers.java
index 526db03..a480502 100644
--- a/org/gjt/sp/jedit/Registers.java
+++ b/org/gjt/sp/jedit/Registers.java
@@ -1,6 +1,6 @@
 /*
  * Registers.java - Register manager
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2003 Slava Pestov
@@ -62,7 +62,7 @@ import org.gjt.sp.util.Log;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: Registers.java 20594 2011-12-09 17:53:47Z kpouer $
+ * @version $Id: Registers.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class Registers
 {
diff --git a/org/gjt/sp/jedit/RegistersListener.java b/org/gjt/sp/jedit/RegistersListener.java
index 3f71163..9594fe7 100644
--- a/org/gjt/sp/jedit/RegistersListener.java
+++ b/org/gjt/sp/jedit/RegistersListener.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/ServiceListHandler.java b/org/gjt/sp/jedit/ServiceListHandler.java
index 7da5e6c..8a1418c 100644
--- a/org/gjt/sp/jedit/ServiceListHandler.java
+++ b/org/gjt/sp/jedit/ServiceListHandler.java
@@ -1,6 +1,6 @@
 /*
  * ServiceManager.java - Handles services.xml files in plugins
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -37,7 +37,7 @@ import org.gjt.sp.util.Log;
 /**
  * @since jEdit 4.2pre1
  * @author Slava Pestov
- * @version $Id: ServiceListHandler.java 16676 2009-12-18 14:44:32Z shlomy $
+ * @version $Id: ServiceListHandler.java 21831 2012-06-18 22:54:17Z ezust $
  */
 class ServiceListHandler extends DefaultHandler
 {
diff --git a/org/gjt/sp/jedit/ServiceManager.java b/org/gjt/sp/jedit/ServiceManager.java
index 4a37bf6..16362d6 100644
--- a/org/gjt/sp/jedit/ServiceManager.java
+++ b/org/gjt/sp/jedit/ServiceManager.java
@@ -1,6 +1,6 @@
 /*
  * ServiceManager.java - Handles services.xml files in plugins
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -94,7 +94,7 @@ import org.gjt.sp.jedit.buffer.FoldHandler;
  *
  * @since jEdit 4.2pre1
  * @author Slava Pestov
- * @version $Id: ServiceManager.java 21608 2012-04-25 22:20:35Z ezust $
+ * @version $Id: ServiceManager.java 22920 2013-04-06 15:03:55Z kerik-sf $
  */
 public class ServiceManager
 {
@@ -109,7 +109,18 @@ public class ServiceManager
 		ServiceListHandler dh = new ServiceListHandler(plugin,uri);
 		try
 		{
-			if (!XMLUtilities.parseXML(uri.openStream(), dh)
+			InputStream in = uri.openStream();
+			if(in == null)
+			{
+				// this happened when calling generateCache() in the context of 'find orphan jars'
+				// in org.gjt.sp.jedit.pluginmgr.ManagePanel.FindOrphan.actionPerformed(ActionEvent)
+				// because for not loaded plugins, the plugin will not be added to the list of pluginJars
+				// so the org.gjt.sp.jedit.proto.jeditresource.PluginResURLConnection will not find the plugin
+				// to read the resource from.
+				// Better log a small error message than a big stack trace
+				Log.log(Log.WARNING, ServiceManager.class, "Unable to open: " + uri);
+			}
+			else  if (!XMLUtilities.parseXML(uri.openStream(), dh)
 				&& cache != null)
 			{
 				cache.cachedServices = dh.getCachedServices();
diff --git a/org/gjt/sp/jedit/SettingsReloader.java b/org/gjt/sp/jedit/SettingsReloader.java
index a3f3051..11ed2cd 100644
--- a/org/gjt/sp/jedit/SettingsReloader.java
+++ b/org/gjt/sp/jedit/SettingsReloader.java
@@ -1,6 +1,6 @@
 /*
  * SettingsReloader.java - Utility class reloads macros and modes when necessary
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/SettingsXML.java b/org/gjt/sp/jedit/SettingsXML.java
index 37b6fe9..be3e237 100644
--- a/org/gjt/sp/jedit/SettingsXML.java
+++ b/org/gjt/sp/jedit/SettingsXML.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Kazutoshi Satoda
diff --git a/org/gjt/sp/jedit/SplitConfigParser.java b/org/gjt/sp/jedit/SplitConfigParser.java
index b1acfc7..9f875a7 100644
--- a/org/gjt/sp/jedit/SplitConfigParser.java
+++ b/org/gjt/sp/jedit/SplitConfigParser.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2004 Slava Pestov
diff --git a/org/gjt/sp/jedit/TextUtilities.java b/org/gjt/sp/jedit/TextUtilities.java
index 65acbee..3400a5f 100644
--- a/org/gjt/sp/jedit/TextUtilities.java
+++ b/org/gjt/sp/jedit/TextUtilities.java
@@ -1,7 +1,7 @@
 /*
  * TextUtilities.java - Various text functions
  * Copyright (C) 1998, 2005 Slava Pestov
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * This program is free software; you can redistribute it and/or
@@ -42,7 +42,7 @@ import org.gjt.sp.util.StandardUtilities;
  * </ul>
  *
  * @author Slava Pestov
- * @version $Id: TextUtilities.java 20176 2011-10-30 19:30:37Z kpouer $
+ * @version $Id: TextUtilities.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class TextUtilities
 {
diff --git a/org/gjt/sp/jedit/View.java b/org/gjt/sp/jedit/View.java
index 3850511..dfad3bd 100644
--- a/org/gjt/sp/jedit/View.java
+++ b/org/gjt/sp/jedit/View.java
@@ -1,6 +1,6 @@
 /*
  * View.java - jEdit view
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2004 Slava Pestov
@@ -36,11 +36,15 @@ import java.io.StringReader;
 import java.net.Socket;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.Stack;
 
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 import javax.swing.JComponent;
 import javax.swing.JFrame;
 import javax.swing.JMenu;
@@ -127,7 +131,7 @@ import org.gjt.sp.util.StandardUtilities;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: View.java 22382 2012-10-15 03:29:48Z ezust $
+ * @version $Id: View.java 22815 2013-02-27 19:23:28Z ezust $
  */
 public class View extends JFrame implements InputHandlerProvider
 {
@@ -315,7 +319,7 @@ public class View extends JFrame implements InputHandlerProvider
 	{
 		addToolBar(group, DEFAULT_LAYER, toolBar);
 	}
-	
+
 	/**
 	 * Adds a tool bar to this view.
 	 * @param group The tool bar group to add to
@@ -640,7 +644,7 @@ public class View extends JFrame implements InputHandlerProvider
 	//}}}
 
 	//}}}
-	
+
 	//{{{ Buffers, edit panes, split panes
 
 	//{{{ splitHorizontally() method
@@ -679,7 +683,7 @@ public class View extends JFrame implements InputHandlerProvider
 
 		editPane.saveCaretInfo();
 		EditPane oldEditPane = editPane;
-		EditPane newEditPane = createEditPane(oldEditPane);
+		EditPane newEditPane = createEditPane(oldEditPane.getBufferSet(), oldEditPane.getBuffer());
 //		setEditPane(newEditPane);
 		newEditPane.loadCaretInfo();
 
@@ -957,45 +961,37 @@ public class View extends JFrame implements InputHandlerProvider
 			return editPane.getBuffer();
 	} //}}}
 
-	//{{{ setBuffer() method
-	/**
-	 * Sets the current edit pane's buffer.
-	 * @param buffer The buffer
-	 */
-	public void setBuffer(Buffer buffer)
-	{
-		setBuffer(buffer,false);
-	} //}}}
-
-	//{{{ setBuffer() method
+	//{{{ getBuffers() method
 	/**
-	 * Sets the current edit pane's buffer.
-	 * @param buffer The buffer
-	 * @param disableFileStatusCheck Disables file status checking
-	 * regardless of the state of the checkFileStatus property
+	 * Returns all Buffers opened in this View.
+	 * @since jEdit 5.1
 	 */
-	public void setBuffer(Buffer buffer, boolean disableFileStatusCheck)
+	public Buffer[] getBuffers()
 	{
-		setBuffer(buffer, disableFileStatusCheck, true);
-	} //}}}
+		BufferSetManager mgr = jEdit.getBufferSetManager();
+		Collection<Buffer> retval = new HashSet<Buffer>();
+		for (EditPane ep: getEditPanes())
+		{
+			BufferSet bs = ep.getBufferSet();
+			Collections.addAll(retval, bs.getAllBuffers());
+			// If scope is not editpane, then all buffersets
+			// are the same and we got what we need.
+			if (mgr.getScope() != BufferSet.Scope.editpane)
+				break;
+		}
+		Buffer[] bufs = new Buffer[retval.size()];
+		retval.toArray(bufs);
+		return bufs;
+	}//}}}
 
 	//{{{ setBuffer() method
 	/**
 	 * Sets the current edit pane's buffer.
 	 * @param buffer The buffer
-	 * @param disableFileStatusCheck Disables file status checking
-	 * regardless of the state of the checkFileStatus property
-	 * @param focus Whether the textarea should request focus
-	 * @since jEdit 4.3pre13
 	 */
-	public void setBuffer(Buffer buffer, boolean disableFileStatusCheck, boolean focus)
+	public void setBuffer(Buffer buffer)
 	{
-		editPane.setBuffer(buffer, focus);
-		int check = jEdit.getIntegerProperty("checkFileStatus");
-		if(!disableFileStatusCheck && (check == GeneralOptionPane.checkFileStatus_all ||
-						  check == GeneralOptionPane.checkFileStatus_operations ||
-						  check == GeneralOptionPane.checkFileStatus_focusBuffer))
-			jEdit.checkBufferStatus(this, true);
+		editPane.setBuffer(buffer);
 	} //}}}
 
 	//{{{ goToBuffer() method
@@ -1302,7 +1298,7 @@ public class View extends JFrame implements InputHandlerProvider
 	} //}}}
 
 	// {{{ closeAllMenus()
-	/** closes any popup menus that may have been opened 
+	/** closes any popup menus that may have been opened
 	    @since jEdit 4.4pre1
 	*/
 	public void closeAllMenus()
@@ -1310,7 +1306,7 @@ public class View extends JFrame implements InputHandlerProvider
 		MenuSelectionManager.defaultManager().clearSelectedPath();
 		KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
 	} // }}}
-	
+
 	//{{{ Package-private members
 	View prev;
 	View next;
@@ -1323,7 +1319,7 @@ public class View extends JFrame implements InputHandlerProvider
 		plainView = config.plainView;
 
 		enableEvents(AWTEvent.KEY_EVENT_MASK);
-		
+
 		// OS X users expect a preview of the window rather than an icon
 		if (!OperatingSystem.isMacOS())
 			setIconImage(GUIUtilities.getEditorIcon());
@@ -1402,6 +1398,12 @@ public class View extends JFrame implements InputHandlerProvider
 		}
 	} //}}}
 
+	//{{{ isFullScreenMode method
+	public boolean isFullScreenMode() 
+	{
+		return fullScreenMode;
+	}//}}}
+	
 	//{{{ toggleFullScreen() method
 	public void toggleFullScreen()
 	{
@@ -1568,7 +1570,7 @@ public class View extends JFrame implements InputHandlerProvider
 		mainPanel.add(mainContent, BorderLayout.CENTER);
 		if (c instanceof JSplitPane)
 		{
-			splitPane = (JSplitPane)c;	
+			splitPane = (JSplitPane)c;
 		}
 		else
 		{
@@ -1618,7 +1620,7 @@ public class View extends JFrame implements InputHandlerProvider
 			}
 		}
 
-		setBuffer(buffer,false, focus);
+		editPane.setBuffer(buffer, focus);
 		return editPane;
 	} //}}}
 
@@ -1982,20 +1984,14 @@ loop:		while (true)
 	} //}}}
 
 	//{{{ createEditPane() methods
-	private EditPane createEditPane(Buffer buffer)
+	private EditPane createEditPane(@Nonnull Buffer buffer)
 	{
-		EditPane editPane = new EditPane(this, null, buffer);
-		JEditTextArea textArea = editPane.getTextArea();
-		textArea.addFocusListener(new FocusHandler());
-		textArea.addCaretListener(new CaretHandler());
-		textArea.addScrollListener(new ScrollHandler());
-		EditBus.send(new EditPaneUpdate(editPane,EditPaneUpdate.CREATED));
-		return editPane;
+		return createEditPane(null, buffer);
 	}
 
-	private EditPane createEditPane(EditPane oldEditPane)
+	private EditPane createEditPane(@Nullable BufferSet bufferSetSource, @Nonnull Buffer buffer)
 	{
-		EditPane editPane = new EditPane(this, oldEditPane.getBufferSet(), oldEditPane.getBuffer());
+		EditPane editPane = new EditPane(this, bufferSetSource, buffer);
 		JEditTextArea textArea = editPane.getTextArea();
 		textArea.addFocusListener(new FocusHandler());
 		textArea.addCaretListener(new CaretHandler());
@@ -2019,6 +2015,7 @@ loop:		while (true)
 		EditBus.send(new ViewUpdate(this,ViewUpdate.EDIT_PANE_CHANGED));
 	} //}}}
 
+
 	//{{{ handleBufferUpdate() method
 	@EBHandler
 	public void handleBufferUpdate(BufferUpdate msg)
@@ -2056,7 +2053,26 @@ loop:		while (true)
 		}
 	} //}}}
 
+	//{{{ handleViewUpdate() method
+	@EBHandler
+	public void handleViewUpdate(ViewUpdate msg)
+	{
+		// only have my view handle each update message
+		if (msg.getView() == null || msg.getView() != this) return;
+		final int check = jEdit.getIntegerProperty("checkFileStatus");
+		if ((check == 0) || !jEdit.isStartupDone()) return;
+		// "buffer visit" also includes checking the buffer when you change editpanes.
+		if ((msg.getWhat() == ViewUpdate.EDIT_PANE_CHANGED) &&
+			((check & GeneralOptionPane.checkFileStatus_focusBuffer) > 0))
+			jEdit.checkBufferStatus(View.this, true);
+		else if ((msg.getWhat() == ViewUpdate.ACTIVATED) &&
+			(check & GeneralOptionPane.checkFileStatus_focus) > 0)
+				jEdit.checkBufferStatus(View.this,
+					(check != GeneralOptionPane.checkFileStatus_focus));
+	}//}}}
+
 	//{{{ closeDuplicateBuffers() method
+	/** Used if exclusive buffersets are enabled */
 	private void closeDuplicateBuffers(EditPaneUpdate epu)
 	{
 		if (!jEdit.getBooleanProperty("buffersets.exclusive"))
@@ -2071,7 +2087,7 @@ loop:		while (true)
 		if (view != this)
 			return;
 		final Buffer b = ep.getBuffer();
-
+		if (b.isDirty()) return;
 		jEdit.visit(new JEditVisitorAdapter()
 		{
 			@Override
@@ -2186,32 +2202,21 @@ loop:		while (true)
 		@Override
 		public void windowActivated(WindowEvent evt)
 		{
-			boolean editPaneChanged =
-				jEdit.getActiveViewInternal() != View.this;
+			boolean appFocus = false;
+			boolean viewChanged = false;
+			View oldView = jEdit.getActiveViewInternal();
+			// check if view is changed
+			if (oldView != View.this) viewChanged = true;
+			/* ACTIVATED currently means whenever the View gets focus.
+			Ideally it should be only when the View changes or we are
+			focusing on a View after previously using in another application.
+			Currently, we also get ACTIVATED messages after a closed jEdit dialog.
+			I consider this a bug which we should fix some day. */
+			if (evt.getOppositeWindow() == null) appFocus = true;
 			jEdit.setActiveView(View.this);
-
-			// People have reported hangs with JDK 1.4; might be
-			// caused by modal dialogs being displayed from
-			// windowActivated()
-			EventQueue.invokeLater(new Runnable()
-			{
-				@Override
-				public void run()
-				{
-					int check = jEdit.getIntegerProperty("checkFileStatus");
-					if(check == GeneralOptionPane.checkFileStatus_focus ||
-					   check == GeneralOptionPane.checkFileStatus_all)
-						jEdit.checkBufferStatus(View.this,false);
-					else if(check == GeneralOptionPane.checkFileStatus_focusBuffer)
-						jEdit.checkBufferStatus(View.this,true);
-				}
-			});
-
-			if (editPaneChanged)
-			{
-				EditBus.send(new ViewUpdate(View.this,ViewUpdate
-					.ACTIVATED));
-			}
+//			Log.log(Log.DEBUG, this, "appFocus:" + appFocus + " viewChanged:" + viewChanged);
+			if (appFocus || viewChanged)
+				EditBus.send(new ViewUpdate(View.this, ViewUpdate.ACTIVATED));
 		}
 
 		@Override
@@ -2284,7 +2289,7 @@ loop:		while (true)
 				setLocationRelativeTo(parent);
 			else
 			{
-				if(OperatingSystem.isX11() && Debug.GEOMETRY_WORKAROUND) 
+				if(OperatingSystem.isX11() && Debug.GEOMETRY_WORKAROUND)
 					new GUIUtilities.UnixWorkaround(this,"view",desired,config.extState);
 				else
 				{
@@ -2324,5 +2329,5 @@ loop:		while (true)
 		}
 	}//}}}
 	 //}}}
-	
+
 }
diff --git a/org/gjt/sp/jedit/actions.xml b/org/gjt/sp/jedit/actions.xml
index 3fc0620..8c199d3 100644
--- a/org/gjt/sp/jedit/actions.xml
+++ b/org/gjt/sp/jedit/actions.xml
@@ -2,7 +2,8 @@
 <!DOCTYPE ACTIONS SYSTEM "actions.dtd">
 
 <!-- jEdit action table                                                      -->
-<!-- Copyright (C) 2000, 2003 Slava Pestov                                   -->
+<!-- Copyright (C) 2000, 2013 Slava Pestov, Alan Ezust, Shlomy Reinstein,
+		              Matthieu Casanova, Kazutoshi Satoda            -->
 
 <!-- :tabSize=8:indentSize=8:noTabs=false:                                   -->
 <!-- :folding=indent:collapseFolds=1:mode=jedit-actions:		     -->
@@ -1505,12 +1506,18 @@
 	<CODE>
 		wm.toggleDockAreas();
 	</CODE>
+	<IS_SELECTED>
+		wm.willToggleHide();
+	</IS_SELECTED>
 </ACTION>
 
 <ACTION NAME="toggle-full-screen">
 	<CODE>
 		view.toggleFullScreen();
 	</CODE>
+	<IS_SELECTED>
+	        view.isFullScreenMode();
+	</IS_SELECTED>
 </ACTION>
 
 <ACTION NAME="toggle-gutter">
diff --git a/org/gjt/sp/jedit/browser/AbstractBrowserTask.java b/org/gjt/sp/jedit/browser/AbstractBrowserTask.java
index 7b39da1..25caa7e 100644
--- a/org/gjt/sp/jedit/browser/AbstractBrowserTask.java
+++ b/org/gjt/sp/jedit/browser/AbstractBrowserTask.java
@@ -1,6 +1,6 @@
 /*
  * AbstractBrowserTask
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright © 2010 Matthieu Casanova
@@ -32,7 +32,7 @@ import org.gjt.sp.util.ThreadUtilities;
 
 /**
  * @author Matthieu Casanova
- * @version $Id: AbstractBrowserTask.java 19705 2011-07-26 17:19:05Z kpouer $
+ * @version $Id: AbstractBrowserTask.java 22851 2013-03-17 11:03:48Z thomasmey $
  */
 abstract class AbstractBrowserTask extends Task
 {
diff --git a/org/gjt/sp/jedit/browser/BrowserCommandsMenu.java b/org/gjt/sp/jedit/browser/BrowserCommandsMenu.java
index de545f0..de3ba9a 100644
--- a/org/gjt/sp/jedit/browser/BrowserCommandsMenu.java
+++ b/org/gjt/sp/jedit/browser/BrowserCommandsMenu.java
@@ -1,6 +1,6 @@
 /*
  * BrowserCommandsMenu.java - provides various commands
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2003 Slava Pestov
@@ -36,7 +36,7 @@ import org.gjt.sp.jedit.menu.MenuItemTextComparator;
 //}}}
 
 /**
- * @version $Id: BrowserCommandsMenu.java 20834 2012-01-17 16:29:14Z kpouer $
+ * @version $Id: BrowserCommandsMenu.java 22900 2013-03-28 21:22:13Z ezust $
  * @author Slava Pestov and Jason Ginchereau
  */
 public class BrowserCommandsMenu extends JPopupMenu
@@ -104,16 +104,12 @@ public class BrowserCommandsMenu extends JPopupMenu
 				|| browser.getMode() == VFSBrowser.BROWSER_DIALOG))
 			{
 				add(createMenuItem("open", "22x22/actions/document-open.png"));
-				JMenuItem openDesktop = GUIUtilities
-					.loadMenuItem(VFSBrowser.getActionContext(),
-						      "vfs.browser.open-desktop", true);
-				openDesktop.setIcon(GUIUtilities.loadIcon("22x22/actions/document-open.png"));
-				add(openDesktop);
-				add(GUIUtilities.loadMenu(
-					VFSBrowser.getActionContext(),
-					"vfs.browser.open-in"));
-				add(createMenuItem("insert"));
-
+				add(GUIUtilities.loadMenu(VFSBrowser.getActionContext(), "vfs.browser.open-in"));
+				if (browser.getSelectedFiles().length == 1) 
+				{
+					add(createMenuItem("open-desktop", "22x22/actions/document-open.png"));
+					add(createMenuItem("insert"));
+				}
 				if(fileOpen)
 					add(createMenuItem("close"));
 			}
@@ -318,6 +314,7 @@ public class BrowserCommandsMenu extends JPopupMenu
 	{
 		JMenu pluginMenu = new JMenu(jEdit.getProperty(
 			"vfs.browser.plugins.label"));
+		GUIUtilities.setAutoMnemonic(pluginMenu);
 		return (JMenu)browser.createPluginsMenu(pluginMenu,false);
 
 	} //}}}
diff --git a/org/gjt/sp/jedit/browser/BrowserView.java b/org/gjt/sp/jedit/browser/BrowserView.java
index 35b49e0..85a0c28 100644
--- a/org/gjt/sp/jedit/browser/BrowserView.java
+++ b/org/gjt/sp/jedit/browser/BrowserView.java
@@ -1,6 +1,6 @@
 /*
  * BrowserView.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2003 Slava Pestov
@@ -29,7 +29,6 @@ import javax.swing.*;
 
 import java.awt.event.*;
 import java.awt.*;
-import java.io.File;
 import java.io.IOException;
 import java.util.*;
 
@@ -43,7 +42,7 @@ import org.gjt.sp.util.ThreadUtilities;
 /**
  * VFS browser tree view.
  * @author Slava Pestov
- * @version $Id: BrowserView.java 21962 2012-07-31 16:44:29Z ezust $
+ * @version $Id: BrowserView.java 22045 2012-08-23 08:44:05Z kpouer $
  */
 class BrowserView extends JPanel
 {
@@ -70,6 +69,7 @@ class BrowserView extends JPanel
 
 		table = new VFSDirectoryEntryTable(this);
 		table.addMouseListener(new TableMouseHandler());
+		table.addKeyListener(new TableKeyListener());
 		table.setName("file");
 		JScrollPane tableScroller = new JScrollPane(table);
 		tableScroller.setMinimumSize(new Dimension(0,0));
@@ -514,6 +514,37 @@ class BrowserView extends JPanel
 		}
 	} //}}}
 
+	//{{{ TableKeyListener class
+	private class TableKeyListener extends KeyAdapter
+	{
+		@Override
+		public void keyPressed(KeyEvent e)
+		{
+			switch(e.getKeyCode())
+			{
+				case KeyEvent.VK_CONTEXT_MENU:
+					if(popup != null && popup.isVisible())
+					{
+						popup.setVisible(false);
+						popup = null;
+						return;
+					}
+
+					int row = table.getSelectedRow();
+					Point pos = new Point(0, row * table.getRowHeight());
+					if(row == -1)
+						showFilePopup(null,table,pos);
+					else
+					{
+						if(!table.getSelectionModel().isSelectedIndex(row))
+							table.getSelectionModel().setSelectionInterval(row,row);
+						showFilePopup(getSelectedFiles(),table,pos);
+					}
+					break;
+			}
+		}
+	} //}}}
+
 	//{{{ TableMouseHandler class
 	private class TableMouseHandler extends MouseAdapter
 	{
diff --git a/org/gjt/sp/jedit/browser/DeleteBrowserTask.java b/org/gjt/sp/jedit/browser/DeleteBrowserTask.java
index 1a41f2d..fc81211 100644
--- a/org/gjt/sp/jedit/browser/DeleteBrowserTask.java
+++ b/org/gjt/sp/jedit/browser/DeleteBrowserTask.java
@@ -1,100 +1,100 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- * Portions Copyright (C) 2000, 2003 Slava Pestov
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.browser;
-
-//{{{ Imports
-import org.gjt.sp.jedit.io.VFS;
-import org.gjt.sp.jedit.io.VFSManager;
-import org.gjt.sp.jedit.jEdit;
-import org.gjt.sp.util.Log;
-
-import java.io.IOException;
-//}}}
-
-/**
- * @author Matthieu CAsanova
- * @version $Id: BrowserIORequest.java 12504 2008-04-22 23:12:43Z ezust $
- */
-class DeleteBrowserTask extends AbstractBrowserTask
-{
-	//{{{ DeleteBrowserTask constructor
-
-	/**
-	 * Creates a new browser I/O request.
-	 *
-	 * @param browser The VFS browser instance
-	 * @param path    The first path name to operate on
-	 */
-	DeleteBrowserTask(VFSBrowser browser,
-			  Object session, VFS vfs, String path)
-	{
-		super(browser, session, vfs, path, null);
-	} //}}}
-
-	//{{{ run() method
-	@Override
-	public void _run()
-	{
-		try
-		{
-			setCancellable(true);
-			String[] args = {path};
-			setStatus(jEdit.getProperty("vfs.status.deleting", args));
-
-			path = vfs._canonPath(session, path, browser);
-
-
-			if (!vfs._delete(session, path, browser))
-				VFSManager.error(browser, path, "ioerror.delete-error", null);
-		}
-		catch (IOException io)
-		{
-			setCancellable(false);
-			Log.log(Log.ERROR, this, io);
-			String[] pp = {io.toString()};
-			VFSManager.error(browser, path, "ioerror.directory-error", pp);
-		}
-		finally
-		{
-			try
-			{
-				vfs._endVFSSession(session, browser);
-			}
-			catch (IOException io)
-			{
-				setCancellable(false);
-				Log.log(Log.ERROR, this, io);
-				String[] pp = {io.toString()};
-				VFSManager.error(browser, path, "ioerror.directory-error", pp);
-			}
-		}
-	} //}}}
-
-	//{{{ toString() method
-	public String toString()
-	{
-		return getClass().getName() + "[type=DELETE"
-		    + ",vfs=" + vfs + ",path=" + path +
-		    ']';
-	} //}}}
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ * Portions Copyright (C) 2000, 2003 Slava Pestov
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.browser;
+
+//{{{ Imports
+import org.gjt.sp.jedit.io.VFS;
+import org.gjt.sp.jedit.io.VFSManager;
+import org.gjt.sp.jedit.jEdit;
+import org.gjt.sp.util.Log;
+
+import java.io.IOException;
+//}}}
+
+/**
+ * @author Matthieu CAsanova
+ * @version $Id: BrowserIORequest.java 12504 2008-04-22 23:12:43Z ezust $
+ */
+class DeleteBrowserTask extends AbstractBrowserTask
+{
+	//{{{ DeleteBrowserTask constructor
+
+	/**
+	 * Creates a new browser I/O request.
+	 *
+	 * @param browser The VFS browser instance
+	 * @param path    The first path name to operate on
+	 */
+	DeleteBrowserTask(VFSBrowser browser,
+			  Object session, VFS vfs, String path)
+	{
+		super(browser, session, vfs, path, null);
+	} //}}}
+
+	//{{{ run() method
+	@Override
+	public void _run()
+	{
+		try
+		{
+			setCancellable(true);
+			String[] args = {path};
+			setStatus(jEdit.getProperty("vfs.status.deleting", args));
+
+			path = vfs._canonPath(session, path, browser);
+
+
+			if (!vfs._delete(session, path, browser))
+				VFSManager.error(browser, path, "ioerror.delete-error", null);
+		}
+		catch (IOException io)
+		{
+			setCancellable(false);
+			Log.log(Log.ERROR, this, io);
+			String[] pp = {io.toString()};
+			VFSManager.error(browser, path, "ioerror.directory-error", pp);
+		}
+		finally
+		{
+			try
+			{
+				vfs._endVFSSession(session, browser);
+			}
+			catch (IOException io)
+			{
+				setCancellable(false);
+				Log.log(Log.ERROR, this, io);
+				String[] pp = {io.toString()};
+				VFSManager.error(browser, path, "ioerror.directory-error", pp);
+			}
+		}
+	} //}}}
+
+	//{{{ toString() method
+	public String toString()
+	{
+		return getClass().getName() + "[type=DELETE"
+		    + ",vfs=" + vfs + ",path=" + path +
+		    ']';
+	} //}}}
+}
diff --git a/org/gjt/sp/jedit/browser/FileCellRenderer.java b/org/gjt/sp/jedit/browser/FileCellRenderer.java
index f0207c0..044a20b 100644
--- a/org/gjt/sp/jedit/browser/FileCellRenderer.java
+++ b/org/gjt/sp/jedit/browser/FileCellRenderer.java
@@ -1,6 +1,6 @@
 /*
  * FileCellRenderer.java - renders table cells for the VFS browser
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999 Jason Ginchereau
@@ -38,7 +38,7 @@ import org.gjt.sp.jedit.*;
 
 /**
  * Local filesystem VFS.
- * @version $Id: FileCellRenderer.java 19866 2011-08-29 16:09:14Z kpouer $
+ * @version $Id: FileCellRenderer.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class FileCellRenderer extends DefaultTableCellRenderer
 {
diff --git a/org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java b/org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
index 3dae252..a49f068 100644
--- a/org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
+++ b/org/gjt/sp/jedit/browser/ListDirectoryBrowserTask.java
@@ -1,6 +1,6 @@
 /*
  * ListDirectoryBrowserTask
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright © 2010 Matthieu Casanova
@@ -35,7 +35,7 @@ import java.io.IOException;
 
 /**
  * @author Matthieu Casanova
- * @version $Id: ListDirectoryBrowserTask.java 19705 2011-07-26 17:19:05Z kpouer $
+ * @version $Id: ListDirectoryBrowserTask.java 21831 2012-06-18 22:54:17Z ezust $
  */
 class ListDirectoryBrowserTask extends AbstractBrowserTask
 {
diff --git a/org/gjt/sp/jedit/browser/MkDirBrowserTask.java b/org/gjt/sp/jedit/browser/MkDirBrowserTask.java
index c962551..29ceb7c 100644
--- a/org/gjt/sp/jedit/browser/MkDirBrowserTask.java
+++ b/org/gjt/sp/jedit/browser/MkDirBrowserTask.java
@@ -1,97 +1,97 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- * Portions Copyright (C) 2000, 2003 Slava Pestov
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.browser;
-
-//{{{ Imports
-import org.gjt.sp.jedit.io.VFS;
-import org.gjt.sp.jedit.io.VFSManager;
-import org.gjt.sp.jedit.jEdit;
-import org.gjt.sp.util.Log;
-
-import java.io.IOException;
-//}}}
-
-/**
- * @author Matthieu CAsanova
- * @version $Id: BrowserIORequest.java 12504 2008-04-22 23:12:43Z ezust $
- */
-class MkDirBrowserTask extends AbstractBrowserTask
-{
-	//{{{ MkDirBrowserTask constructor
-	/**
-	 * Creates a new browser I/O request.
-	 * @param browser The VFS browser instance
-	 * @param path The first path name to operate on
-	 */
-	MkDirBrowserTask(VFSBrowser browser,
-			 Object session, VFS vfs, String path,
-			 Runnable awtRunnable)
-	{
-		super(browser, session, vfs, path, awtRunnable);
-	} //}}}
-
-	//{{{ run() method
-	@Override
-	public void _run()
-	{
-		String[] args = {path};
-		try
-		{
-			setCancellable(true);
-			setStatus(jEdit.getProperty("vfs.status.mkdir",args));
-
-			path = vfs._canonPath(session, path,browser);
-
-			if(!vfs._mkdir(session, path,browser))
-				VFSManager.error(browser, path,"ioerror.mkdir-error",null);
-		}
-		catch(IOException io)
-		{
-			setCancellable(false);
-			Log.log(Log.ERROR,this,io);
-			args[0] = io.toString();
-			VFSManager.error(browser, path,"ioerror",args);
-		}
-		finally
-		{
-			try
-			{
-				vfs._endVFSSession(session,browser);
-			}
-			catch(IOException io)
-			{
-				setCancellable(false);
-				Log.log(Log.ERROR,this,io);
-				args[0] = io.toString();
-				VFSManager.error(browser, path,"ioerror",args);
-			}
-		}
-	} //}}}
-
-	//{{{ toString() method
-	public String toString()
-	{
-		return getClass().getName() + "[type=MKDIR"
-			+ ",vfs=" + vfs + ",path=" + path + ']';
-	} //}}}
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ * Portions Copyright (C) 2000, 2003 Slava Pestov
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.browser;
+
+//{{{ Imports
+import org.gjt.sp.jedit.io.VFS;
+import org.gjt.sp.jedit.io.VFSManager;
+import org.gjt.sp.jedit.jEdit;
+import org.gjt.sp.util.Log;
+
+import java.io.IOException;
+//}}}
+
+/**
+ * @author Matthieu CAsanova
+ * @version $Id: BrowserIORequest.java 12504 2008-04-22 23:12:43Z ezust $
+ */
+class MkDirBrowserTask extends AbstractBrowserTask
+{
+	//{{{ MkDirBrowserTask constructor
+	/**
+	 * Creates a new browser I/O request.
+	 * @param browser The VFS browser instance
+	 * @param path The first path name to operate on
+	 */
+	MkDirBrowserTask(VFSBrowser browser,
+			 Object session, VFS vfs, String path,
+			 Runnable awtRunnable)
+	{
+		super(browser, session, vfs, path, awtRunnable);
+	} //}}}
+
+	//{{{ run() method
+	@Override
+	public void _run()
+	{
+		String[] args = {path};
+		try
+		{
+			setCancellable(true);
+			setStatus(jEdit.getProperty("vfs.status.mkdir",args));
+
+			path = vfs._canonPath(session, path,browser);
+
+			if(!vfs._mkdir(session, path,browser))
+				VFSManager.error(browser, path,"ioerror.mkdir-error",null);
+		}
+		catch(IOException io)
+		{
+			setCancellable(false);
+			Log.log(Log.ERROR,this,io);
+			args[0] = io.toString();
+			VFSManager.error(browser, path,"ioerror",args);
+		}
+		finally
+		{
+			try
+			{
+				vfs._endVFSSession(session,browser);
+			}
+			catch(IOException io)
+			{
+				setCancellable(false);
+				Log.log(Log.ERROR,this,io);
+				args[0] = io.toString();
+				VFSManager.error(browser, path,"ioerror",args);
+			}
+		}
+	} //}}}
+
+	//{{{ toString() method
+	public String toString()
+	{
+		return getClass().getName() + "[type=MKDIR"
+			+ ",vfs=" + vfs + ",path=" + path + ']';
+	} //}}}
+}
diff --git a/org/gjt/sp/jedit/browser/RenameBrowserTask.java b/org/gjt/sp/jedit/browser/RenameBrowserTask.java
index 8ece301..bcfbe13 100644
--- a/org/gjt/sp/jedit/browser/RenameBrowserTask.java
+++ b/org/gjt/sp/jedit/browser/RenameBrowserTask.java
@@ -1,131 +1,131 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- * Portions Copyright (C) 2000, 2003 Slava Pestov
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.browser;
-
-//{{{ Imports
-import org.gjt.sp.jedit.OperatingSystem;
-import org.gjt.sp.jedit.io.FavoritesVFS;
-import org.gjt.sp.jedit.io.VFS;
-import org.gjt.sp.jedit.io.VFSFile;
-import org.gjt.sp.jedit.io.VFSManager;
-import org.gjt.sp.jedit.jEdit;
-import org.gjt.sp.util.Log;
-
-import java.io.IOException;
-//}}}
-
-/**
- * @author Matthieu Casanova
- * @version $Id: ListDirectoryBrowserTask.java 19692 2011-07-22 15:27:56Z kpouer $
- */
-class RenameBrowserTask extends AbstractBrowserTask
-{
-	//{{{ BrowserIORequest constructor
-	/**
-	 * Creates a new browser I/O request.
-	 *
-	 * @param browser  The VFS browser instance
-	 * @param path1    The first path name to operate on
-	 * @param path2    The second path name to operate on
-	 */
-	RenameBrowserTask(VFSBrowser browser,
-			  Object session, VFS vfs, String path1, String path2,
-			 Runnable awtRunnable)
-	{
-		super(browser, session, vfs, path1, awtRunnable);
-		this.path2 = path2;
-	} //}}}
-
-	//{{{ _run() method
-	@Override
-	public void _run()
-	{
-		try
-		{
-			setCancellable(true);
-			String[] args = {path, path2};
-			setStatus(jEdit.getProperty("vfs.status.renaming", args));
-
-			path = vfs._canonPath(session, path, browser);
-			path2 = vfs._canonPath(session, path2, browser);
-
-			if (!(vfs instanceof FavoritesVFS))
-			{
-				VFSFile file = vfs._getFile(session, path2, browser);
-				if (file != null)
-				{
-					if ((OperatingSystem.isCaseInsensitiveFS())
-							&& path.equalsIgnoreCase(path2))
-					{
-						// allow user to change name
-						// case
-					}
-					else
-					{
-						VFSManager.error(browser, path,
-								"ioerror.rename-exists",
-								new String[]{path2});
-						return;
-					}
-				}
-			}
-
-			if (!vfs._rename(session, path, path2, browser))
-				VFSManager.error(browser, path, "ioerror.rename-error",
-				    new String[]{path2});
-		}
-		catch (IOException io)
-		{
-			setCancellable(false);
-			Log.log(Log.ERROR, this, io);
-			String[] pp = {io.toString()};
-			VFSManager.error(browser, path, "ioerror.directory-error", pp);
-		}
-		finally
-		{
-			try
-			{
-				vfs._endVFSSession(session, browser);
-			}
-			catch (IOException io)
-			{
-				setCancellable(false);
-				Log.log(Log.ERROR, this, io);
-				String[] pp = {io.toString()};
-				VFSManager.error(browser, path, "ioerror.directory-error", pp);
-			}
-		}
-	} //}}}
-
-	//{{{ toString() method
-	public String toString()
-	{
-		return getClass().getName() + "[type=RENAME"
-		    + ",vfs=" + vfs + ",path=" + path
-		    + ",path2=" + path2 + ']';
-	} //}}}
-
-	//{{{ Private members
-	private String path2;
-	//}}}
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ * Portions Copyright (C) 2000, 2003 Slava Pestov
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.browser;
+
+//{{{ Imports
+import org.gjt.sp.jedit.OperatingSystem;
+import org.gjt.sp.jedit.io.FavoritesVFS;
+import org.gjt.sp.jedit.io.VFS;
+import org.gjt.sp.jedit.io.VFSFile;
+import org.gjt.sp.jedit.io.VFSManager;
+import org.gjt.sp.jedit.jEdit;
+import org.gjt.sp.util.Log;
+
+import java.io.IOException;
+//}}}
+
+/**
+ * @author Matthieu Casanova
+ * @version $Id: ListDirectoryBrowserTask.java 19692 2011-07-22 15:27:56Z kpouer $
+ */
+class RenameBrowserTask extends AbstractBrowserTask
+{
+	//{{{ BrowserIORequest constructor
+	/**
+	 * Creates a new browser I/O request.
+	 *
+	 * @param browser  The VFS browser instance
+	 * @param path1    The first path name to operate on
+	 * @param path2    The second path name to operate on
+	 */
+	RenameBrowserTask(VFSBrowser browser,
+			  Object session, VFS vfs, String path1, String path2,
+			 Runnable awtRunnable)
+	{
+		super(browser, session, vfs, path1, awtRunnable);
+		this.path2 = path2;
+	} //}}}
+
+	//{{{ _run() method
+	@Override
+	public void _run()
+	{
+		try
+		{
+			setCancellable(true);
+			String[] args = {path, path2};
+			setStatus(jEdit.getProperty("vfs.status.renaming", args));
+
+			path = vfs._canonPath(session, path, browser);
+			path2 = vfs._canonPath(session, path2, browser);
+
+			if (!(vfs instanceof FavoritesVFS))
+			{
+				VFSFile file = vfs._getFile(session, path2, browser);
+				if (file != null)
+				{
+					if ((OperatingSystem.isCaseInsensitiveFS())
+							&& path.equalsIgnoreCase(path2))
+					{
+						// allow user to change name
+						// case
+					}
+					else
+					{
+						VFSManager.error(browser, path,
+								"ioerror.rename-exists",
+								new String[]{path2});
+						return;
+					}
+				}
+			}
+
+			if (!vfs._rename(session, path, path2, browser))
+				VFSManager.error(browser, path, "ioerror.rename-error",
+				    new String[]{path2});
+		}
+		catch (IOException io)
+		{
+			setCancellable(false);
+			Log.log(Log.ERROR, this, io);
+			String[] pp = {io.toString()};
+			VFSManager.error(browser, path, "ioerror.directory-error", pp);
+		}
+		finally
+		{
+			try
+			{
+				vfs._endVFSSession(session, browser);
+			}
+			catch (IOException io)
+			{
+				setCancellable(false);
+				Log.log(Log.ERROR, this, io);
+				String[] pp = {io.toString()};
+				VFSManager.error(browser, path, "ioerror.directory-error", pp);
+			}
+		}
+	} //}}}
+
+	//{{{ toString() method
+	public String toString()
+	{
+		return getClass().getName() + "[type=RENAME"
+		    + ",vfs=" + vfs + ",path=" + path
+		    + ",path2=" + path2 + ']';
+	} //}}}
+
+	//{{{ Private members
+	private String path2;
+	//}}}
+}
diff --git a/org/gjt/sp/jedit/browser/VFSBrowser.java b/org/gjt/sp/jedit/browser/VFSBrowser.java
index 643e38a..6cefbcb 100644
--- a/org/gjt/sp/jedit/browser/VFSBrowser.java
+++ b/org/gjt/sp/jedit/browser/VFSBrowser.java
@@ -1,6 +1,6 @@
 /*
  * VFSBrowser.java - VFS browser
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2003 Slava Pestov
@@ -56,7 +56,7 @@ import org.gjt.sp.jedit.menu.MenuItemTextComparator;
  * VFSFileChooserDialog.
  *
  * @author Slava Pestov
- * @version $Id: VFSBrowser.java 21555 2012-04-03 15:17:35Z kpouer $
+ * @version $Id: VFSBrowser.java 22996 2013-05-17 09:43:00Z kpouer $
  */
 public class VFSBrowser extends JPanel implements DefaultFocusComponent,
 	DockableWindow
@@ -76,7 +76,7 @@ public class VFSBrowser extends JPanel implements DefaultFocusComponent,
 	 */
 	public static final int SAVE_DIALOG = 1;
 	/**
-	 * Choose directory dialog mode.
+	 * File Open Dialog with extra context menu actions like the BROWSER mode.
 	 */
 	public static final int BROWSER_DIALOG = 4;
 	/**
@@ -368,11 +368,9 @@ public class VFSBrowser extends JPanel implements DefaultFocusComponent,
 			}
 			else if("last".equals(defaultPath))
 			{
-				HistoryModel pathModel = HistoryModel.getModel("vfs.browser.path");
-				if(pathModel.getSize() == 0)
+				path = getLastVisitedPath();
+				if (path == null)
 					path = "~";
-				else
-					path = pathModel.getItem(0);
 			}
 			else if("favorites".equals(defaultPath))
 				path = "favorites:";
@@ -606,6 +604,21 @@ public class VFSBrowser extends JPanel implements DefaultFocusComponent,
 	}
 	// }}}
 
+	//{{{ getLastVisitedPath() method
+	/**
+	 * Returns the last path visited by VFSBrowser. If no path was ever
+	 * visited, returns <code>null</code>,
+	 * @since 5.1
+	 */
+	public static String getLastVisitedPath()
+	{
+		HistoryModel pathModel = HistoryModel.getModel("vfs.browser.path");
+		if(pathModel.getSize() == 0)
+			return null;
+		else
+			return pathModel.getItem(0);
+	} //}}}
+
 	//{{{ setDirectory() method
 	public void setDirectory(String path)
 	{
@@ -674,21 +687,29 @@ public class VFSBrowser extends JPanel implements DefaultFocusComponent,
 			dialogType = "vfs.browser.delete-confirm";
 		}
 
-		StringBuilder buf = new StringBuilder();
 		String typeStr = "files";
 		for(int i = 0; i < files.length; i++)
 		{
-			buf.append(files[i].getPath());
-			buf.append('\n');
 			if (files[i].getType() == VFSFile.DIRECTORY)
+			{
 				typeStr = "directories and their contents";
+				break;
+			}
 		}
 
-		Object[] args = { buf.toString(), typeStr};
+		// In the previous version the first argument was the file list, now it is a list so the file list is not
+		// created anymore. But for compatibility an empty string is used.
+		Object[] args = { "", typeStr };
+
+		JList list = new JList(files);
+		list.setVisibleRowCount(10);
+		JPanel panel = new JPanel(new BorderLayout());
+		panel.add(new JScrollPane(list));
+		panel.add(new JLabel(jEdit.getProperty(dialogType+".message", args)), BorderLayout.PAGE_START);
+		int result = JOptionPane
+			.showConfirmDialog(this, panel, jEdit.getProperty(dialogType+".title"),
+							   JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
 
-		int result = GUIUtilities.confirm(this,dialogType,args,
-			JOptionPane.YES_NO_OPTION,
-			JOptionPane.WARNING_MESSAGE);
 		if(result != JOptionPane.YES_OPTION)
 			return;
 
@@ -1048,6 +1069,9 @@ public class VFSBrowser extends JPanel implements DefaultFocusComponent,
 			case VFSFile.DIRECTORY:
 				targetPath = file.getPath();
 				break;
+			default:
+				Log.log(Log.ERROR, this, "Unknown file type " + file.getType());
+				return;
 		}
 		VFS vfs = VFSManager.getVFSForPath(targetPath);
 		Object vfsSession = null;
@@ -1077,12 +1101,13 @@ public class VFSBrowser extends JPanel implements DefaultFocusComponent,
 					sources.add(copiedFile.getAbsolutePath());
 				}
 			}
-			CopyFileWorker worker = new CopyFileWorker(this, sources, targetPath);
+			CopyFileWorker worker = new CopyFileWorker(this, sources, targetPath, CopyFileWorker.Behavior.RENAME);
 			ThreadUtilities.runInBackground(worker);
 		}
 		finally
 		{
-			vfs._endVFSSession(vfsSession, this);
+			if (vfsSession != null)
+				vfs._endVFSSession(vfsSession, this);
 		}
 	} //}}}
 
@@ -1101,7 +1126,7 @@ public class VFSBrowser extends JPanel implements DefaultFocusComponent,
 		setDirectory(MiscUtilities.getParentOfPath(path));
 		// Do not change this until all VFS Browser tasks are
 		// done in ThreadUtilities
-		VFSManager.runInAWTThread(new Runnable()
+		AwtRunnableQueue.INSTANCE.runAfterIoTasks(new Runnable()
 		{
 			public void run()
 			{
@@ -1634,7 +1659,7 @@ check_selected: for(int i = 0; i < selectedFiles.length; i++)
 			{
 				// Do not change this until all VFS Browser tasks are
 				// done in ThreadUtilities
-				VFSManager.runInAWTThread(new Runnable()
+				AwtRunnableQueue.INSTANCE.runAfterIoTasks(new Runnable()
 				{
 					public void run()
 					{
@@ -1770,6 +1795,7 @@ check_selected: for(int i = 0; i < selectedFiles.length; i++)
 			addKeyListener(this);
 			if(OperatingSystem.isMacOSLF())
 				putClientProperty("JButton.buttonType","toolbar");
+			setAction(new Action());
 		} //}}}
 
 		public void keyReleased(KeyEvent e) {}
@@ -1803,6 +1829,15 @@ check_selected: for(int i = 0; i < selectedFiles.length; i++)
 				}
 			}
 		} //}}}
+		
+		//{{{ Action class
+		class Action extends AbstractAction
+		{
+			public void actionPerformed(ActionEvent ae)
+			{
+				doPopup();
+			}
+		} //}}}
 	} //}}}
 
 
@@ -1814,6 +1849,7 @@ check_selected: for(int i = 0; i < selectedFiles.length; i++)
 		CommandsMenuButton()
 		{
 			setText(jEdit.getProperty("vfs.browser.commands.label"));
+			GUIUtilities.setAutoMnemonic(this);
 			setName("commands");
 			popup = new BrowserCommandsMenu(VFSBrowser.this, null);
 		} //}}}
@@ -1834,7 +1870,7 @@ check_selected: for(int i = 0; i < selectedFiles.length; i++)
 		PluginsMenuButton()
 		{
 			setText(jEdit.getProperty("vfs.browser.plugins.label"));
-
+			GUIUtilities.setAutoMnemonic(this);
 			setName("plugins");
 
 			setMargin(new Insets(1,1,1,1));
@@ -1874,6 +1910,7 @@ check_selected: for(int i = 0; i < selectedFiles.length; i++)
 		FavoritesMenuButton()
 		{
 			setText(jEdit.getProperty("vfs.browser.favorites.label"));
+			GUIUtilities.setAutoMnemonic(this);
 			setName("favorites");
 			createPopupMenu();
 
diff --git a/org/gjt/sp/jedit/browser/VFSDirectoryEntryTable.java b/org/gjt/sp/jedit/browser/VFSDirectoryEntryTable.java
index 0470f2d..ac488b3 100644
--- a/org/gjt/sp/jedit/browser/VFSDirectoryEntryTable.java
+++ b/org/gjt/sp/jedit/browser/VFSDirectoryEntryTable.java
@@ -1,6 +1,6 @@
 /*
  * VFSDirectoryEntryTable.java - VFS directory entry table
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003, 2005 Slava Pestov
@@ -49,7 +49,7 @@ import org.gjt.sp.util.ThreadUtilities;
 
 /**
  * @author Slava Pestov
- * @version $Id: VFSDirectoryEntryTable.java 21706 2012-05-23 16:58:56Z ezust $
+ * @version $Id: VFSDirectoryEntryTable.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.2pre1
  */
 public class VFSDirectoryEntryTable extends JTable
diff --git a/org/gjt/sp/jedit/browser/VFSDirectoryEntryTableModel.java b/org/gjt/sp/jedit/browser/VFSDirectoryEntryTableModel.java
index dd33cb1..c8ebeeb 100644
--- a/org/gjt/sp/jedit/browser/VFSDirectoryEntryTableModel.java
+++ b/org/gjt/sp/jedit/browser/VFSDirectoryEntryTableModel.java
@@ -1,6 +1,6 @@
 /*
  * VFSDirectoryEntryTableModel.java - VFS directory entry table model
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003, 2005 Slava Pestov
@@ -36,7 +36,7 @@ import org.gjt.sp.util.StandardUtilities;
 
 /**
  * @author Slava Pestov
- * @version $Id: VFSDirectoryEntryTableModel.java 14450 2009-01-24 22:56:40Z kpouer $
+ * @version $Id: VFSDirectoryEntryTableModel.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.2pre1
  */
 public class VFSDirectoryEntryTableModel extends AbstractTableModel
diff --git a/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java b/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
index a53b882..b5bcbe4 100644
--- a/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
+++ b/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
@@ -1,6 +1,6 @@
 /*
  * VFSFileChooserDialog.java - VFS file chooser
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2005 Slava Pestov
@@ -38,6 +38,7 @@ import org.gjt.sp.jedit.gui.EnhancedDialog;
 import org.gjt.sp.jedit.io.*;
 import org.gjt.sp.jedit.*;
 import org.gjt.sp.jedit.buffer.JEditBuffer;
+import org.gjt.sp.jedit.bufferio.IoTask;
 import org.gjt.sp.util.*;
 //}}}
 
@@ -45,7 +46,7 @@ import org.gjt.sp.util.*;
  * Wraps the VFS browser in a modal dialog.
  * Shows up when "File-Open" is used. 
  * @author Slava Pestov
- * @version $Id: VFSFileChooserDialog.java 20945 2012-01-24 20:24:26Z ezust $
+ * @version $Id: VFSFileChooserDialog.java 22943 2013-04-22 11:44:40Z thomasmey $
  */
 public class VFSFileChooserDialog extends EnhancedDialog
 {
@@ -119,7 +120,7 @@ public class VFSFileChooserDialog extends EnhancedDialog
 	public void dispose()
 	{
 		GUIUtilities.saveGeometry(this,"vfs.browser.dialog");
-		VFSManager.getIOThreadPool().removeProgressListener(workThreadHandler);
+		TaskManager.instance.removeTaskListener(ioTaskHandler);
 		super.dispose();
 	} //}}}
 
@@ -175,9 +176,9 @@ public class VFSFileChooserDialog extends EnhancedDialog
 		if(session == null)
 			return;
 
-		VFSManager.runInWorkThread(new GetFileTypeRequest(
+		ThreadUtilities.runInBackground(new GetFileTypeRequest(
 			vfs,session,path,type));
-		VFSManager.runInAWTThread(new Runnable()
+		AwtRunnableQueue.INSTANCE.runAfterIoTasks(new Runnable()
 		{
 			public void run()
 			{
@@ -257,7 +258,7 @@ public class VFSFileChooserDialog extends EnhancedDialog
 	private JButton ok;
 	private JButton cancel;
 	private boolean isOK;
-	private WorkThreadHandler workThreadHandler;
+	private TaskListener ioTaskHandler;
 	//}}}
 
 	//{{{ getDefaultTitle() method
@@ -373,8 +374,8 @@ public class VFSFileChooserDialog extends EnhancedDialog
 
 		content.add(BorderLayout.SOUTH,panel);
 
-		VFSManager.getIOThreadPool().addProgressListener(
-			workThreadHandler = new WorkThreadHandler());
+		TaskManager.instance.addTaskListener(
+				ioTaskHandler = new IoTaskHandler());
 
 		pack();
 		GUIUtilities.loadGeometry(this,"vfs.browser.dialog");
@@ -498,7 +499,7 @@ public class VFSFileChooserDialog extends EnhancedDialog
 				return;
 			}
 
-			for(int i = 0; i < files.length; i++)
+			for(int i = 0, n = files.length; i < n; i++)
 			{
 				if(files[i].getType() == VFSFile.FILE)
 				{
@@ -525,41 +526,65 @@ public class VFSFileChooserDialog extends EnhancedDialog
 		} //}}}
 	} //}}}
 
-	//{{{ WorkThreadListener class
-	private class WorkThreadHandler implements WorkThreadProgressListener
+	//{{{ IoTaskListener class
+	private class IoTaskHandler implements TaskListener
 	{
-		//{{{ statusUpdate() method
-		public void statusUpdate(final WorkThreadPool threadPool,
-			int threadIndex)
+		private final Runnable cursorStatus = new Runnable()
 		{
-			SwingUtilities.invokeLater(new Runnable()
+			public void run()
 			{
-				public void run()
+				int requestCount = TaskManager.instance.countIoTasks();
+				if(requestCount == 0)
 				{
-					int requestCount = threadPool.getRequestCount();
-					if(requestCount == 0)
-					{
-						getContentPane().setCursor(
-							Cursor.getDefaultCursor());
-					}
-					else if(requestCount >= 1)
-					{
-						getContentPane().setCursor(
-							Cursor.getPredefinedCursor(
-							Cursor.WAIT_CURSOR));
-					}
+					getContentPane().setCursor(
+						Cursor.getDefaultCursor());
 				}
-			});
+				else if(requestCount >= 1)
+				{
+					getContentPane().setCursor(
+						Cursor.getPredefinedCursor(
+						Cursor.WAIT_CURSOR));
+				}
+			}
+		};
+
+		//{{{ waiting() method
+		public void waiting(Task task)
+		{
+			SwingUtilities.invokeLater(cursorStatus);
+		} //}}}
+	
+		//{{{ running() method
+		public void running(Task task)
+		{
+			SwingUtilities.invokeLater(cursorStatus);
+		} //}}}
+	
+		//{{{ done() method
+		public void done(Task task)
+		{
+			SwingUtilities.invokeLater(cursorStatus);
+		} //}}}
+
+		//{{{ statusUpdated() method
+		public void statusUpdated(Task task)
+		{
+		} //}}}
+
+		//{{{ maximumUpdated() method
+		public void maximumUpdated(Task task)
+		{
 		} //}}}
 
 		//{{{ progressUpdate() method
-		public void progressUpdate(WorkThreadPool threadPool, int threadIndex)
+		public void valueUpdated(Task task)
 		{
+			SwingUtilities.invokeLater(cursorStatus);
 		} //}}}
 	} //}}}
 
 	//{{{ GetFileTypeRequest class
-	private class GetFileTypeRequest implements Runnable
+	private class GetFileTypeRequest extends IoTask
 	{
 		VFS    vfs;
 		Object session;
@@ -569,13 +594,14 @@ public class VFSFileChooserDialog extends EnhancedDialog
 		GetFileTypeRequest(VFS vfs, Object session,
 			String path, int[] type)
 		{
+			super();
 			this.vfs     = vfs;
 			this.session = session;
 			this.path    = path;
 			this.type    = type;
 		}
 
-		public void run()
+		public void _run()
 		{
 			try
 			{
diff --git a/org/gjt/sp/jedit/browser/VFSFileNameField.java b/org/gjt/sp/jedit/browser/VFSFileNameField.java
index c6435ab..c334005 100644
--- a/org/gjt/sp/jedit/browser/VFSFileNameField.java
+++ b/org/gjt/sp/jedit/browser/VFSFileNameField.java
@@ -1,6 +1,6 @@
 /*
  * VFSFileNameField.java - File name field with completion
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003, 2005 Slava Pestov
@@ -31,11 +31,12 @@ import org.gjt.sp.jedit.io.*;
 import org.gjt.sp.jedit.MiscUtilities;
 
 import org.gjt.sp.util.Log;
+import org.gjt.sp.util.TaskManager;
 //}}}
 
 /**
  * @author Slava Pestov
- * @version $Id: VFSFileNameField.java 19318 2011-02-01 04:22:08Z vanza $
+ * @version $Id: VFSFileNameField.java 22851 2013-03-17 11:03:48Z thomasmey $
  * @since jEdit 4.2pre1 (public since 4.5pre1)
  */
 public class VFSFileNameField extends HistoryTextField
@@ -204,7 +205,7 @@ public class VFSFileNameField extends HistoryTextField
 				return;
 
 			browser.setDirectory(dir);
-			VFSManager.waitForRequests();
+			TaskManager.instance.waitForIoTasks();
 
 			if(index == -1)
 			{
@@ -223,7 +224,7 @@ public class VFSFileNameField extends HistoryTextField
 					return;
 
 				browser.setDirectory(dir);
-				VFSManager.waitForRequests();
+				TaskManager.instance.waitForIoTasks();
 
 				currentText = currentText.substring(index + 1);
 			}
@@ -274,7 +275,7 @@ public class VFSFileNameField extends HistoryTextField
 		VFS vfs = VFSManager.getVFSForPath(parent);
 		if((vfs.getCapabilities() & VFS.LOW_LATENCY_CAP) != 0)
 		{
-			VFSManager.waitForRequests();
+			TaskManager.instance.waitForIoTasks();
 			setText(name);
 			browser.getBrowserView().getTable().doTypeSelect(
 				name,browser.getMode() == VFSBrowser
diff --git a/org/gjt/sp/jedit/buffer/BufferAdapter.java b/org/gjt/sp/jedit/buffer/BufferAdapter.java
index e011e41..b00a769 100644
--- a/org/gjt/sp/jedit/buffer/BufferAdapter.java
+++ b/org/gjt/sp/jedit/buffer/BufferAdapter.java
@@ -1,6 +1,6 @@
 /*
  * BufferAdapter.java - Buffer listener adapter
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2005 Slava Pestov
@@ -26,7 +26,7 @@ package org.gjt.sp.jedit.buffer;
  * An adapter you can subclass to avoid having to implement all the methods
  * of the {@link BufferListener} interface.
  * @author Slava Pestov
- * @version $Id: BufferAdapter.java 17966 2010-06-03 08:27:12Z kpouer $
+ * @version $Id: BufferAdapter.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.3pre3
  */
 public abstract class BufferAdapter implements BufferListener
diff --git a/org/gjt/sp/jedit/buffer/BufferListener.java b/org/gjt/sp/jedit/buffer/BufferListener.java
index 27fb7f1..a0cc816 100644
--- a/org/gjt/sp/jedit/buffer/BufferListener.java
+++ b/org/gjt/sp/jedit/buffer/BufferListener.java
@@ -1,6 +1,6 @@
 /*
  * BufferListener.java - Buffer listener interface
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2005 Slava Pestov
@@ -39,7 +39,7 @@ package org.gjt.sp.jedit.buffer;
  * implementing it directly.
  *
  * @author Slava Pestov
- * @version $Id: BufferListener.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: BufferListener.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.3pre3
  */
 public interface BufferListener
diff --git a/org/gjt/sp/jedit/buffer/BufferSegment.java b/org/gjt/sp/jedit/buffer/BufferSegment.java
index 2fb4c8b..45f493c 100644
--- a/org/gjt/sp/jedit/buffer/BufferSegment.java
+++ b/org/gjt/sp/jedit/buffer/BufferSegment.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Marcelo Vanzin
@@ -26,7 +26,7 @@ package org.gjt.sp.jedit.buffer;
  * "linked list" approach.
  *
  * @author Marcelo Vanzin
- * @version $Id: BufferSegment.java 12726 2008-05-29 20:21:14Z k_satoda $
+ * @version $Id: BufferSegment.java 21971 2012-08-02 20:32:37Z jarekczek $
  * @since jEdit 4.3pre15
  */
 class BufferSegment implements CharSequence
diff --git a/org/gjt/sp/jedit/buffer/BufferUndoListener.java b/org/gjt/sp/jedit/buffer/BufferUndoListener.java
index fd0039c..0ff5a03 100644
--- a/org/gjt/sp/jedit/buffer/BufferUndoListener.java
+++ b/org/gjt/sp/jedit/buffer/BufferUndoListener.java
@@ -1,6 +1,6 @@
 /*
  * BufferUndoListener.java - Buffer undo listener interface
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2009 Shlomy Reinstein
@@ -33,7 +33,7 @@ package org.gjt.sp.jedit.buffer;
  * <code>JEditBuffer.removeBufferUndoListener<code>, respectively.
  *
  * @author Shlomy Reinstein
- * @version $Id: BufferUndoListener.java 16098 2009-08-27 21:59:29Z shlomy $
+ * @version $Id: BufferUndoListener.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.3pre18
  */
 public interface BufferUndoListener
diff --git a/org/gjt/sp/jedit/buffer/ContentManager.java b/org/gjt/sp/jedit/buffer/ContentManager.java
index 804208a..414afc8 100644
--- a/org/gjt/sp/jedit/buffer/ContentManager.java
+++ b/org/gjt/sp/jedit/buffer/ContentManager.java
@@ -1,6 +1,6 @@
 /*
  * ContentManager.java - Manages text content
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2002 Slava Pestov
@@ -32,7 +32,7 @@ import javax.swing.text.Segment;
  * called through, implements such protection.
  *
  * @author Slava Pestov
- * @version $Id: ContentManager.java 17813 2010-05-12 14:20:37Z k_satoda $
+ * @version $Id: ContentManager.java 21885 2012-06-27 14:06:58Z k_satoda $
  * @since jEdit 4.0pre1
  */
 class ContentManager
@@ -47,13 +47,13 @@ class ContentManager
 	public String getText(int start, int len)
 	{
 		if(start >= gapStart)
-			return new String(text,start + gapEnd - gapStart,len);
+			return new String(text,start + gapLength(),len);
 		else if(start + len <= gapStart)
 			return new String(text,start,len);
 		else
 		{
 			return new String(text,start,gapStart - start)
-				.concat(new String(text,gapEnd,start + len - gapStart));
+				.concat(new String(text,gapEnd(),start + len - gapStart));
 		}
 	}
 
@@ -75,7 +75,7 @@ class ContentManager
 		if(start >= gapStart)
 		{
 			seg.array = text;
-			seg.offset = start + gapEnd - gapStart;
+			seg.offset = start + gapLength();
 			seg.count = len;
 		}
 		else if(start + len <= gapStart)
@@ -92,7 +92,7 @@ class ContentManager
 			System.arraycopy(text,start,seg.array,0,gapStart - start);
 
 			// copy text after gap
-			System.arraycopy(text,gapEnd,seg.array,gapStart - start,
+			System.arraycopy(text,gapEnd(),seg.array,gapStart - start,
 				len + start - gapStart);
 
 			seg.offset = 0;
@@ -114,13 +114,13 @@ class ContentManager
 	public CharSequence getSegment(int start, int len)
 	{
 		if(start >= gapStart)
-			return new BufferSegment(text,start + gapEnd - gapStart,len);
+			return new BufferSegment(text,start + gapLength(),len);
 		else if(start + len <= gapStart)
 			return new BufferSegment(text,start,len);
 		else
 		{
 			return new BufferSegment(text,start,gapStart - start,
-				new BufferSegment(text,gapEnd,start + len - gapStart));
+				new BufferSegment(text,gapEnd(),start + len - gapStart));
 		}
 	} //}}}
 
@@ -128,13 +128,7 @@ class ContentManager
 	public void insert(int start, String str)
 	{
 		int len = str.length();
-		moveGapStart(start);
-		if(gapEnd - gapStart < len)
-		{
-			ensureCapacity(length + len + 1024);
-			moveGapEnd(start + len + 1024);
-		}
-
+		prepareGapForInsertion(start, len);
 		str.getChars(0,len,text,start);
 		gapStart += len;
 		length += len;
@@ -148,13 +142,7 @@ class ContentManager
 	public void insert(int start, CharSequence str)
 	{
 		int len = str.length();
-		moveGapStart(start);
-		if(gapEnd - gapStart < len)
-		{
-			ensureCapacity(length + len + 1024);
-			moveGapEnd(start + len + 1024);
-		}
-
+		prepareGapForInsertion(start, len);
 		for (int i = 0; i < len; i++)
 		{
 			text[start+i] = str.charAt(i);
@@ -165,13 +153,7 @@ class ContentManager
 
 	public void insert(int start, Segment seg)
 	{
-		moveGapStart(start);
-		if(gapEnd - gapStart < seg.count)
-		{
-			ensureCapacity(length + seg.count + 1024);
-			moveGapEnd(start + seg.count + 1024);
-		}
-
+		prepareGapForInsertion(start, seg.count);
 		System.arraycopy(seg.array,seg.offset,text,start,seg.count);
 		gapStart += seg.count;
 		length += seg.count;
@@ -180,8 +162,10 @@ class ContentManager
 	//{{{ _setContent() method
 	public void _setContent(char[] text, int length)
 	{
+		assert text != null;
+		assert text.length >= length;
 		this.text = text;
-		this.gapStart = this.gapEnd = 0;
+		this.gapStart = length;
 		this.length = length;
 	} //}}}
 
@@ -189,19 +173,31 @@ class ContentManager
 	public void remove(int start, int len)
 	{
 		moveGapStart(start);
-		gapEnd += len;
 		length -= len;
 	} //}}}
 
 	//{{{ Private members
-	private char[] text;
+	private static final char[] EMPTY_TEXT = new char[0];
+	private char[] text = EMPTY_TEXT;
 	private int gapStart;
-	private int gapEnd;
 	private int length;
 
+	//{{{ gapEnd() method
+	private int gapEnd()
+	{
+		return gapStart + gapLength();
+	} //}}}
+
+	//{{{ gapLength() method
+	private int gapLength()
+	{
+		return text.length - length;
+	} //}}}
+
 	//{{{ moveGapStart() method
 	private void moveGapStart(int newStart)
 	{
+		int gapEnd = gapEnd();
 		int newEnd = gapEnd + (newStart - gapStart);
 
 		if(newStart == gapStart)
@@ -220,14 +216,6 @@ class ContentManager
 		}
 
 		gapStart = newStart;
-		gapEnd = newEnd;
-	} //}}}
-
-	//{{{ moveGapEnd() method
-	private void moveGapEnd(int newEnd)
-	{
-		System.arraycopy(text,gapEnd,text,newEnd,length - gapStart);
-		gapEnd = newEnd;
 	} //}}}
 
 	//{{{ ensureCapacity() method
@@ -235,11 +223,24 @@ class ContentManager
 	{
 		if(capacity >= text.length)
 		{
+			int gapEndOld = gapEnd();
+
 			char[] textN = new char[capacity * 2];
-			System.arraycopy(text,0,textN,0,length + (gapEnd - gapStart));
+			System.arraycopy(text,0,textN,0,text.length);
 			text = textN;
+
+			int gapEndNew = gapEnd();
+			System.arraycopy(text,gapEndOld,text,gapEndNew,text.length - gapEndNew);
 		}
 	} //}}}
 
+	//{{{ prepareGapForInsertion() method
+	private void prepareGapForInsertion(int start, int len)
+	{
+		moveGapStart(start);
+		if(gapLength() < len)
+			ensureCapacity(length + len);
+	} //}}}
+
 	//}}}
 }
diff --git a/org/gjt/sp/jedit/buffer/DefaultFoldHandlerProvider.java b/org/gjt/sp/jedit/buffer/DefaultFoldHandlerProvider.java
index 85e8c18..8ec969c 100644
--- a/org/gjt/sp/jedit/buffer/DefaultFoldHandlerProvider.java
+++ b/org/gjt/sp/jedit/buffer/DefaultFoldHandlerProvider.java
@@ -1,6 +1,6 @@
 /*
  * DummyFoldHandler.java - Fold handler used when folding is switched off
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001 Slava Pestov
diff --git a/org/gjt/sp/jedit/buffer/DummyFoldHandler.java b/org/gjt/sp/jedit/buffer/DummyFoldHandler.java
index a4ea45b..0c6e785 100644
--- a/org/gjt/sp/jedit/buffer/DummyFoldHandler.java
+++ b/org/gjt/sp/jedit/buffer/DummyFoldHandler.java
@@ -1,6 +1,6 @@
 /*
  * DummyFoldHandler.java - Fold handler used when folding is switched off
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001 Slava Pestov
@@ -27,7 +27,7 @@ import javax.swing.text.Segment;
 /**
  * A fold handler that does nothing.
  * @author Slava Pestov
- * @version $Id: DummyFoldHandler.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: DummyFoldHandler.java 22962 2013-04-30 13:55:18Z kpouer $
  * @since jEdit 4.0pre1
  */
 public class DummyFoldHandler extends FoldHandler
@@ -49,6 +49,7 @@ public class DummyFoldHandler extends FoldHandler
 	 * @return The fold level of the specified line
 	 * @since jEdit 4.0pre1
 	 */
+	@Override
 	public int getFoldLevel(JEditBuffer buffer, int lineIndex, Segment seg)
 	{
 		return 0;
diff --git a/org/gjt/sp/jedit/buffer/ExplicitFoldHandler.java b/org/gjt/sp/jedit/buffer/ExplicitFoldHandler.java
index 64fb8f9..32cc9db 100644
--- a/org/gjt/sp/jedit/buffer/ExplicitFoldHandler.java
+++ b/org/gjt/sp/jedit/buffer/ExplicitFoldHandler.java
@@ -1,6 +1,6 @@
 /*
  * ExplicitFoldHandler.java - Explicit fold handler
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001 Slava Pestov
@@ -29,7 +29,7 @@ import javax.swing.text.Segment;
  * embedded in the text.
  *
  * @author Slava Pestov
- * @version $Id: ExplicitFoldHandler.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: ExplicitFoldHandler.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.0pre1
  */
 public class ExplicitFoldHandler extends FoldHandler
diff --git a/org/gjt/sp/jedit/buffer/FoldHandler.java b/org/gjt/sp/jedit/buffer/FoldHandler.java
index dea6bfc..08f4398 100644
--- a/org/gjt/sp/jedit/buffer/FoldHandler.java
+++ b/org/gjt/sp/jedit/buffer/FoldHandler.java
@@ -1,6 +1,6 @@
 /*
  * FoldHandler.java - Fold handler interface
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2005 Slava Pestov
@@ -39,7 +39,7 @@ import javax.swing.text.Segment;
  * See {@link org.gjt.sp.jedit.ServiceManager} for details.
  *
  * @author Slava Pestov
- * @version $Id: FoldHandler.java 18919 2010-11-04 10:52:55Z kpouer $
+ * @version $Id: FoldHandler.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.3pre3
  */
 public abstract class FoldHandler
diff --git a/org/gjt/sp/jedit/buffer/FoldHandlerProvider.java b/org/gjt/sp/jedit/buffer/FoldHandlerProvider.java
index 37a5a50..22e8177 100644
--- a/org/gjt/sp/jedit/buffer/FoldHandlerProvider.java
+++ b/org/gjt/sp/jedit/buffer/FoldHandlerProvider.java
@@ -1,6 +1,6 @@
 /*
  * FoldHandlerProvider.java - Fold handler provider interface
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/buffer/IndentFoldHandler.java b/org/gjt/sp/jedit/buffer/IndentFoldHandler.java
index 3dbfaa8..7c7ba78 100644
--- a/org/gjt/sp/jedit/buffer/IndentFoldHandler.java
+++ b/org/gjt/sp/jedit/buffer/IndentFoldHandler.java
@@ -1,6 +1,6 @@
 /*
  * IndentFoldHandler.java - Indent-based fold handler
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2002 Slava Pestov
@@ -30,7 +30,7 @@ import javax.swing.text.Segment;
 /**
  * A fold handler that folds lines based on their indent level.
  * @author Slava Pestov
- * @version $Id: IndentFoldHandler.java 16133 2009-08-31 21:07:15Z shlomy $
+ * @version $Id: IndentFoldHandler.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.0pre1
  */
 public class IndentFoldHandler extends FoldHandler
diff --git a/org/gjt/sp/jedit/buffer/JEditBuffer.java b/org/gjt/sp/jedit/buffer/JEditBuffer.java
index 63c783f..f1a093b 100644
--- a/org/gjt/sp/jedit/buffer/JEditBuffer.java
+++ b/org/gjt/sp/jedit/buffer/JEditBuffer.java
@@ -1,6 +1,6 @@
 /*
  * JEditBuffer.java - jEdit buffer
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2005 Slava Pestov
@@ -33,11 +33,13 @@ import org.gjt.sp.jedit.syntax.*;
 import org.gjt.sp.jedit.textarea.ColumnBlock;
 import org.gjt.sp.jedit.textarea.ColumnBlockLine;
 import org.gjt.sp.jedit.textarea.Node;
+import org.gjt.sp.jedit.textarea.Selection;
 import org.gjt.sp.jedit.textarea.TextArea;
 import org.gjt.sp.util.IntegerArray;
 import org.gjt.sp.util.Log;
 import org.gjt.sp.util.StandardUtilities;
 
+import javax.annotation.Nonnull;
 import javax.swing.text.Position;
 import javax.swing.text.Segment;
 import java.awt.*;
@@ -66,7 +68,7 @@ import java.util.regex.Pattern;
  * </ul>
  *
  * @author Slava Pestov
- * @version $Id: JEditBuffer.java 21754 2012-06-02 18:49:16Z jarekczek $
+ * @version $Id: JEditBuffer.java 22963 2013-04-30 14:07:57Z kpouer $
  *
  * @since jEdit 4.3pre3
  */
@@ -84,7 +86,7 @@ public class JEditBuffer
 	public static final String ENCODING = "encoding";
 
 	//{{{ JEditBuffer constructors
-	public JEditBuffer(Map props)
+
 	{
 		bufferListeners = new Vector<Listener>();
 		lock = new ReentrantReadWriteLock();
@@ -95,7 +97,10 @@ public class JEditBuffer
 		integerArray = new IntegerArray();
 		propertyLock = new Object();
 		properties = new HashMap<Object, PropValue>();
+	}
 
+	public JEditBuffer(Map props)
+	{
 		//{{{ need to convert entries of 'props' to PropValue instances
 		Set<Map.Entry> set = props.entrySet();
 		for (Map.Entry entry : set)
@@ -109,6 +114,8 @@ public class JEditBuffer
 			properties.put(ENCODING,new PropValue(System.getProperty("file.encoding"),false));
 		if(getProperty(LINESEP) == null)
 			properties.put(LINESEP,new PropValue(System.getProperty("line.separator"),false));
+
+		setFoldHandler(new DummyFoldHandler());
 	}
 
 	/**
@@ -117,16 +124,6 @@ public class JEditBuffer
 	 */
 	public JEditBuffer()
 	{
-		bufferListeners = new Vector<Listener>();
-		lock = new ReentrantReadWriteLock();
-		contentMgr = new ContentManager();
-		lineMgr = new LineManager();
-		positionMgr = new PositionManager(this);
-		undoMgr = new UndoManager(this);
-		integerArray = new IntegerArray();
-		propertyLock = new Object();
-		properties = new HashMap<Object, PropValue>();
-
 		properties.put("wrap",new PropValue("none",false));
 		properties.put("folding",new PropValue("none",false));
 		tokenMarker = new TokenMarker();
@@ -2055,6 +2052,7 @@ loop:		for(int i = 0; i < seg.count; i++)
 	 * Returns the current buffer's fold handler.
 	 * @since jEdit 4.2pre1
 	 */
+	@Nonnull
 	public FoldHandler getFoldHandler()
 	{
 		return foldHandler;
@@ -2065,7 +2063,7 @@ loop:		for(int i = 0; i < seg.count; i++)
 	 * Sets the buffer's fold handler.
 	 * @since jEdit 4.2pre2
 	 */
-	public void setFoldHandler(FoldHandler foldHandler)
+	public void setFoldHandler(@Nonnull FoldHandler foldHandler)
 	{
 		FoldHandler oldFoldHandler = this.foldHandler;
 
@@ -2106,12 +2104,14 @@ loop:		for(int i = 0; i < seg.count; i++)
 
 			undoInProgress = true;
 			fireBeginUndo();
-			int caret = undoMgr.undo();
-			if(caret == -1)
+			Selection[] s = undoMgr.undo();
+			if(s == null || s.length == 0)
 				textArea.getToolkit().beep();
 			else
-				textArea.setCaretPosition(caret);
-
+			{
+				textArea.setCaretPosition(s[s.length - 1].getEnd());
+				textArea.setSelection(s);
+			}
 			fireEndUndo();
 			fireTransactionComplete();
 		}
@@ -2146,11 +2146,14 @@ loop:		for(int i = 0; i < seg.count; i++)
 
 			undoInProgress = true;
 			fireBeginRedo();
-			int caret = undoMgr.redo();
-			if(caret == -1)
+			Selection[] s = undoMgr.redo();
+			if(s == null || s.length == 0)
 				textArea.getToolkit().beep();
 			else
-				textArea.setCaretPosition(caret);
+			{
+				textArea.setCaretPosition(s[s.length - 1].getEnd());
+				textArea.setSelection(s);
+			}
 
 			fireEndRedo();
 			fireTransactionComplete();
@@ -2741,6 +2744,7 @@ loop:		for(int i = 0; i < seg.count; i++)
 	private final ContentManager contentMgr;
 	private final LineManager lineMgr;
 	private final PositionManager positionMgr;
+	@Nonnull
 	private FoldHandler foldHandler;
 	private final IntegerArray integerArray;
 	private boolean undoInProgress;
@@ -2752,6 +2756,9 @@ loop:		for(int i = 0; i < seg.count; i++)
 	private boolean io;
 	private final Map<Object, PropValue> properties;
 	private final Object propertyLock;
+	/** This field should be read instead of "elasticTabstops" property
+	  * when efficiency matters. */
+	// synchronization done in TextArea.propertiesChanged()
 	public boolean elasticTabstopsOn = false;
 	private ColumnBlock columnBlock;
 
diff --git a/org/gjt/sp/jedit/buffer/KillRing.java b/org/gjt/sp/jedit/buffer/KillRing.java
index 316271a..9b9ed94 100644
--- a/org/gjt/sp/jedit/buffer/KillRing.java
+++ b/org/gjt/sp/jedit/buffer/KillRing.java
@@ -1,6 +1,6 @@
 /*
  * KillRing.java - Stores deleted text
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003, 2005 Slava Pestov
@@ -51,15 +51,14 @@ public class KillRing implements MutableListModel
 	{
 		int newSize = Math.max(1, historySize);
 		if(ring == null)
-			ring = new UndoManager.RemovedContent[newSize];
+			ring = new String[newSize];
 		else if(newSize != ring.length)
 		{
-			UndoManager.RemovedContent[] newRing = new UndoManager.RemovedContent[
-				newSize];
+			String[] newRing = new String[newSize];
 			int newCount = Math.min(getSize(),newSize);
 			for(int i = 0; i < newCount; i++)
 			{
-				newRing[i] = (UndoManager.RemovedContent)getElementAt(i);
+				newRing[i] = (String)getElementAt(i);
 			}
 			ring = newRing;
 			count = newCount;
@@ -94,22 +93,11 @@ public class KillRing implements MutableListModel
 	 */
 	protected void reset(Collection<?> source)
 	{
-		UndoManager.RemovedContent[] newRing
-			= new UndoManager.RemovedContent[source.size()];
+		String[] newRing = new String[source.size()];
 		int i = 0;
 		for(Object x: source)
 		{
-			UndoManager.RemovedContent element;
-			if(x instanceof String)
-			{
-				element = new UndoManager.RemovedContent(
-					(String)x);
-			}
-			else
-			{
-				element = (UndoManager.RemovedContent)x;
-			}
-			newRing[i++] = element;
+			newRing[i++] = (String)x;
 		}
 		ring = newRing;
 		count = 0;
@@ -163,7 +151,7 @@ public class KillRing implements MutableListModel
 		called by the 'Paste Deleted' dialog where the performance
 		is not exactly vital */
 		remove(index);
-		add((UndoManager.RemovedContent)value);
+		add((String)value);
 	} //}}}
 
 	//}}}
@@ -171,58 +159,28 @@ public class KillRing implements MutableListModel
 	//{{{ Package-private members
 
 	//{{{ changed() method
-	void changed(UndoManager.RemovedContent rem)
+	void changed(String oldStr, String newStr)
 	{
-		if(rem.inKillRing)
-		{
-			// compare existing entries' hashcode with this
-			int length = (wrap ? ring.length : count);
-			int kill = -1;
-
-			for(int i = 0; i < length; i++)
-			{
-				if(ring[i] != rem
-					&& ring[i].hashcode == rem.hashcode
-					&& ring[i].str.equals(rem.str))
-				{
-					// we don't want duplicate
-					// entries in the kill ring
-					kill = i;
-					break;
-				}
-			}
-
-			if(kill != -1)
-				remove(kill);
-		}
+		int i = indexOf(oldStr);
+		if(i != -1)
+			ring[i] = newStr;
 		else
-			add(rem);
+			add(newStr);
 	} //}}}
 
 	//{{{ add() method
-	void add(UndoManager.RemovedContent rem)
+	void add(String removed)
 	{
-		// compare existing entries' hashcode with this
-		int length = (wrap ? ring.length : count);
-		for(int i = 0; i < length; i++)
-		{
-			if(ring[i].hashcode == rem.hashcode)
-			{
-				// strings might be equal!
-				if(ring[i].str.equals(rem.str))
-				{
-					// we don't want duplicate entries
-					// in the kill ring
-					return;
-				}
-			}
-		}
+		// we don't want duplicate entries
+		// in the kill ring
+		if(indexOf(removed) != -1)
+			return;
 
 		// no duplicates, check for all-whitespace string
 		boolean allWhitespace = true;
-		for(int i = 0; i < rem.str.length(); i++)
+		for(int i = 0; i < removed.length(); i++)
 		{
-			if(!Character.isWhitespace(rem.str.charAt(i)))
+			if(!Character.isWhitespace(removed.charAt(i)))
 			{
 				allWhitespace = false;
 				break;
@@ -232,12 +190,7 @@ public class KillRing implements MutableListModel
 		if(allWhitespace)
 			return;
 
-		rem.inKillRing = true;
-
-		if(ring[count] != null)
-			ring[count].inKillRing = false;
-
-		ring[count] = rem;
+		ring[count] = removed;
 		if(++count >= ring.length)
 		{
 			wrap = true;
@@ -250,8 +203,7 @@ public class KillRing implements MutableListModel
 	{
 		if(wrap)
 		{
-			UndoManager.RemovedContent[] newRing = new UndoManager.RemovedContent[
-				ring.length];
+			String[] newRing = new String[ring.length];
 			int newCount = 0;
 			for(int j = 0; j < ring.length; j++)
 			{
@@ -259,7 +211,6 @@ public class KillRing implements MutableListModel
 
 				if(i == index)
 				{
-					ring[index].inKillRing = false;
 					continue;
 				}
 
@@ -279,7 +230,7 @@ public class KillRing implements MutableListModel
 	//}}}
 
 	//{{{ Private members
-	private UndoManager.RemovedContent[] ring;
+	private String[] ring;
 	private int count;
 	private boolean wrap;
 	private static KillRing killRing = new KillRing();
@@ -302,5 +253,19 @@ public class KillRing implements MutableListModel
 			return count - index - 1;
 	} //}}}
 
+	//{{{ indexOf() method
+	private int indexOf(String str)
+	{
+		int length = (wrap ? ring.length : count);
+		for(int i = length - 1; i >= 0; i--)
+		{
+			if(ring[i].equals(str))
+			{
+				return i;
+			}
+		}
+		return -1;
+	} //}}}
+
 	//}}}
 }
diff --git a/org/gjt/sp/jedit/buffer/LineManager.java b/org/gjt/sp/jedit/buffer/LineManager.java
index 2dfa01c..7df832f 100644
--- a/org/gjt/sp/jedit/buffer/LineManager.java
+++ b/org/gjt/sp/jedit/buffer/LineManager.java
@@ -1,6 +1,6 @@
 /*
  * LineManager.java - Manages line info, line start offsets, positions
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2004 Slava Pestov
@@ -37,7 +37,7 @@ import org.gjt.sp.util.Log;
  * called through, implements such protection.
  *
  * @author Slava Pestov
- * @version $Id: LineManager.java 21685 2012-05-19 15:38:08Z jarekczek $
+ * @version $Id: LineManager.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.2pre3
  */
 public class LineManager
diff --git a/org/gjt/sp/jedit/buffer/PositionManager.java b/org/gjt/sp/jedit/buffer/PositionManager.java
index a96d81f..aed5117 100644
--- a/org/gjt/sp/jedit/buffer/PositionManager.java
+++ b/org/gjt/sp/jedit/buffer/PositionManager.java
@@ -1,6 +1,6 @@
 /*
  * PositionManager.java - Manages positions
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2005 Slava Pestov
@@ -37,7 +37,7 @@ import org.gjt.sp.util.Log;
  * of the position are implemented separately.
  *
  * @author Slava Pestov
- * @version $Id: PositionManager.java 21727 2012-05-27 17:11:01Z jarekczek $
+ * @version $Id: PositionManager.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.2pre3
  */
 class PositionManager
diff --git a/org/gjt/sp/jedit/buffer/UndoManager.java b/org/gjt/sp/jedit/buffer/UndoManager.java
index 4461c17..78b83af 100644
--- a/org/gjt/sp/jedit/buffer/UndoManager.java
+++ b/org/gjt/sp/jedit/buffer/UndoManager.java
@@ -1,6 +1,6 @@
 /*
  * UndoManager.java - Buffer undo manager
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2005 Slava Pestov
@@ -23,7 +23,9 @@
 package org.gjt.sp.jedit.buffer;
 
 //{{{ Imports
+import org.gjt.sp.util.IntegerArray;
 import org.gjt.sp.util.Log;
+import org.gjt.sp.jedit.textarea.Selection;
 //}}}
 
 /**
@@ -34,7 +36,7 @@ import org.gjt.sp.util.Log;
  * called through, implements such protection.
  *
  * @author Slava Pestov
- * @version $Id: UndoManager.java 16728 2009-12-25 14:12:38Z shlomy $
+ * @version $Id: UndoManager.java 22171 2012-09-06 15:12:05Z ezust $
  * @since jEdit 4.0pre1
  */
 public class UndoManager
@@ -65,24 +67,24 @@ public class UndoManager
 	} //}}}
 
 	//{{{ undo() method
-	public int undo()
+	public Selection[] undo()
 	{
 		if(insideCompoundEdit())
 			throw new InternalError("Unbalanced begin/endCompoundEdit()");
 
 		if(undosLast == null)
-			return -1;
+			return null;
 		else
 		{
 			reviseUndoId();
 			undoCount--;
 
-			int caret = undosLast.undo();
+			Selection s[] = undosLast.undo(this);
 			redosFirst = undosLast;
 			undosLast = undosLast.prev;
 			if(undosLast == null)
 				undosFirst = null;
-			return caret;
+			return s;
 		}
 	} //}}}
 
@@ -93,24 +95,24 @@ public class UndoManager
 	} //}}}
 
 	//{{{ redo() method
-	public int redo()
+	public Selection[] redo()
 	{
 		if(insideCompoundEdit())
 			throw new InternalError("Unbalanced begin/endCompoundEdit()");
 
 		if(redosFirst == null)
-			return -1;
+			return null;
 		else
 		{
 			reviseUndoId();
 			undoCount++;
 
-			int caret = redosFirst.redo();
+			Selection[] s = redosFirst.redo(this);
 			undosLast = redosFirst;
 			if(undosFirst == null)
 				undosFirst = undosLast;
 			redosFirst = redosFirst.next;
-			return caret;
+			return s;
 		}
 	} //}}}
 
@@ -164,7 +166,6 @@ public class UndoManager
 	//{{{ contentInserted() method
 	public void contentInserted(int offset, int length, String text, boolean clearDirty)
 	{
-		Edit last = getLastEdit();
 		Edit toMerge = getMergeEdit();
 
 		if(!clearDirty && toMerge instanceof Insert
@@ -174,27 +175,25 @@ public class UndoManager
 			if(ins.offset == offset)
 			{
 				ins.str = text.concat(ins.str);
-				ins.length += length;
 				return;
 			}
-			else if(ins.offset + ins.length == offset)
+			else if(ins.offset + ins.str.length() == offset)
 			{
 				ins.str = ins.str.concat(text);
-				ins.length += length;
 				return;
 			}
 		}
 
-		Insert ins = new Insert(this,offset,length,text);
+		Insert ins = new Insert(offset,text);
 
 		if(clearDirty)
 		{
-			redoClearDirty = last;
+			redoClearDirty = getLastEdit();
 			undoClearDirty = ins;
 		}
 
 		if(compoundEdit != null)
-			compoundEdit.add(ins);
+			compoundEdit.add(this, ins);
 		else
 		{
 			reviseUndoId();
@@ -205,7 +204,6 @@ public class UndoManager
 	//{{{ contentRemoved() method
 	public void contentRemoved(int offset, int length, String text, boolean clearDirty)
 	{
-		Edit last = getLastEdit();
 		Edit toMerge = getMergeEdit();
 
 		if(!clearDirty && toMerge instanceof Remove
@@ -214,39 +212,40 @@ public class UndoManager
 			Remove rem = (Remove)toMerge;
 			if(rem.offset == offset)
 			{
-				rem.content.str = rem.content.str.concat(text);
-				rem.content.hashcode = rem.content.str.hashCode();
-				rem.length += length;
-				KillRing.getInstance().changed(rem.content);
+				String newStr = rem.str.concat(text);
+				KillRing.getInstance().changed(rem.str, newStr);
+				rem.str = newStr;
 				return;
 			}
 			else if(offset + length == rem.offset)
 			{
-				rem.content.str = text.concat(rem.content.str);
-				rem.content.hashcode = rem.content.str.hashCode();
-				rem.length += length;
-				rem.offset = offset;
-				KillRing.getInstance().changed(rem.content);
+				String newStr = text.concat(rem.str);
+				KillRing.getInstance().changed(rem.str, newStr);
+ 				rem.offset = offset;
+				rem.str = newStr;
 				return;
 			}
 		}
 
-		Remove rem = new Remove(this,offset,length,text);
+		// use String.intern() here as new Strings are created in
+		// JEditBuffer.remove() via undoMgr.contentRemoved(... getText() ...);
+		Remove rem = new Remove(offset,text.intern());
+
 		if(clearDirty)
 		{
-			redoClearDirty = last;
+			redoClearDirty = getLastEdit();
 			undoClearDirty = rem;
 		}
 
 		if(compoundEdit != null)
-			compoundEdit.add(rem);
+			compoundEdit.add(this, rem);
 		else
 		{
 			reviseUndoId();
 			addEdit(rem);
 		}
 
-		KillRing.getInstance().add(rem.content);
+		KillRing.getInstance().add(rem.str);
 	} //}}}
 
 	//{{{ resetClearDirty method
@@ -312,8 +311,7 @@ public class UndoManager
 	//{{{ getMergeEdit() method
 	private Edit getMergeEdit()
 	{
-		Edit last = getLastEdit();
-		return (compoundEdit != null ? compoundEdit.last : last);
+		return (compoundEdit != null ? compoundEdit.last : getLastEdit());
 	} //}}}
 
 	//{{{ getLastEdit() method
@@ -343,147 +341,297 @@ public class UndoManager
 		undoId = new Object();
 	} //}}}
 
-	//}}}
+	//{{{ getReplaceFromRemoveInsert() method
+	// a Replace Edit is a Remove Edit and then an Insert Edit
+	private Replace getReplaceFromRemoveInsert(Edit lastElement, Edit newElement)
+	{
+		if(lastElement instanceof Remove && newElement instanceof Insert)
+		{
+			// don't fold a undoClearDirty Remove Edit, because
+			// it's the identity is significant.
+			if(lastElement == undoClearDirty || newElement == undoClearDirty)
+				return null;
+
+			/* newElement is guaranteed to be an Compound-Insert Edit, redoClearDirty will be an Normal-Insert, Normal-Remove,
+			 * Compound-Remove-Insert-Edit or Compound-Replace-Edit (all possible edit operations)
+			 * redoClearDirty cannot become equal to newElement because:
+			 * - redoClearDirty will be set after the file has been saved and the first new change is made, which
+			 *   could be an Normal-Insert, Normal-Remove, Compound-Replace-Edit, Compound-Remove-Insert-Edit,
+			 *   or null, if this is the first change in the file at all.
+			 *   For Compound-Edit case it will be the last element of the Compound edit.
+			 * - As the first Remove&Insert sequence of a Compound-Edit is never compacted by above if statement,
+			 *   redoClearDirty can never be any of the following Remove&Insert elements, as the user as no option to save the
+			 *   file after the first Remove&Insert sequence, because the GUI is blocked by the search&replace all operation.
+			 */  
+			assert newElement  != redoClearDirty;
+			assert lastElement != redoClearDirty;
+
+			Remove rem = (Remove) lastElement;
+			Insert ins = (Insert) newElement;
+		
+			if(rem.offset == ins.offset)
+			{
+				return new Replace(rem.offset, rem.str, ins.str);
+			}
+		}
+		return null;
+	} //}}}
+
+	//{{{ getCompressedReplaceFromReplaceReplace() method
+	// a CompressedReplace Edit is one to many Replace Edit compressed via offsets
+	private CompressedReplace getCompressedReplaceFromReplaceReplace(Edit lastElement, Edit newElement)
+	{
+
+		if(newElement instanceof Replace)
+		{
+			CompressedReplace rep = null;
+			// try to pack the next Replace into the CompressedReplace
+			if(lastElement instanceof CompressedReplace)
+			{
+				rep = (CompressedReplace) lastElement;
+				return rep.add((Replace) newElement);
+			}
+	
+			// try to create a compressed Replace
+			if(lastElement instanceof Replace)
+			{
+				rep = new CompressedReplace((Replace)lastElement);
+				return rep.add((Replace) newElement);
+			}
+		}
+		return null;
+	} //}}}
 
 	//{{{ Inner classes
 
 	//{{{ Edit class
-	abstract static class Edit
+	private abstract static class Edit
 	{
 		Edit prev, next;
 
 		//{{{ undo() method
-		abstract int undo();
+		/**
+		 * Returns the selection that should be active after performing
+		 * the operation. If no selection should be active, a 0 length
+		 * selection should be returned, pointing the caret location
+		 * to set after the operation.
+		 * <p>Implementation note: undo manager does not receive the actual
+		 * selection, when it records the operations. That's because
+		 * the operations are recorded by <code>Buffer</code>
+		 * class, and this class has no selections,
+		 * which are kept by <code>TextArea</code> class instances.
+		 * So the <code>Selection[]</code>s returned are simply guessed,
+		 * contain the inserted text.
+		 */
+		abstract Selection[] undo(UndoManager mgr);
 		//}}}
 
 		//{{{ redo() method
-		abstract int redo();
+		/**
+		 * @return See {@link #undo}.
+		 * <p>Implementation note: redo always returns caret location only,
+		 * because the actual selection is unknown and we guess it from
+		 * the remove/insert operations. Usually after an action
+		 * the selection becomes empty, so such is the guess.</p>
+		 */
+		abstract Selection[] redo(UndoManager mgr);
 		//}}}
 	} //}}}
 
 	//{{{ Insert class
-	static class Insert extends Edit
+	private static class Insert extends Edit
 	{
 		//{{{ Insert constructor
-		Insert(UndoManager mgr, int offset, int length, String str)
+		Insert(int offset, String str)
 		{
-			this.mgr = mgr;
 			this.offset = offset;
-			this.length = length;
 			this.str = str;
 		} //}}}
 
 		//{{{ undo() method
-		int undo()
+		@Override
+		Selection[] undo(UndoManager mgr)
 		{
-			mgr.buffer.remove(offset,length);
+			mgr.buffer.remove(offset,str.length());
 			if(mgr.undoClearDirty == this)
 				mgr.buffer.setDirty(false);
-			return offset;
+			return new Selection[] { new Selection.Range(offset, offset) };
 		} //}}}
 
 		//{{{ redo() method
-		int redo()
+		@Override
+		Selection[] redo(UndoManager mgr)
 		{
 			mgr.buffer.insert(offset,str);
 			if(mgr.redoClearDirty == this)
 				mgr.buffer.setDirty(false);
-			return offset + length;
+			int caret = offset + str.length();
+			return new Selection[] { new Selection.Range(caret, caret) };
 		} //}}}
 
-		UndoManager mgr;
 		int offset;
-		int length;
 		String str;
 	} //}}}
 
-	//{{{ RemovedContent clas
-	// This class is held in KillRing.
-	public static class RemovedContent
+	//{{{ Remove class
+	private static class Remove extends Edit
 	{
-		String str;
-		int hashcode;
-		boolean inKillRing;
-
-		public RemovedContent(String str)
+		//{{{ Remove constructor
+		Remove(int offset, String str)
 		{
+			this.offset = offset;
 			this.str = str;
-			this.hashcode = str.hashCode();
-		}
+		} //}}}
 
-		public String toString()
+		//{{{ undo() method
+		@Override
+		Selection[] undo(UndoManager mgr)
 		{
-			return str;
-		}
-	}// }}}
+			mgr.buffer.insert(offset,str);
+			if(mgr.undoClearDirty == this)
+				mgr.buffer.setDirty(false);
+			return new Selection[] {
+				new Selection.Range(offset, offset + str.length())
+			};
+		} //}}}
 
-	//{{{ Remove class
-	static class Remove extends Edit
+		//{{{ redo() method
+		@Override
+		Selection[] redo(UndoManager mgr)
+		{
+			mgr.buffer.remove(offset,str.length());
+			if(mgr.redoClearDirty == this)
+				mgr.buffer.setDirty(false);
+			return new Selection[] { new Selection.Range(offset, offset) };
+		} //}}}
+
+		int offset;
+		String str;
+	} //}}}
+
+	//{{{ Replace class
+	private static class Replace extends Edit
 	{
-		//{{{ Remove constructor
-		Remove(UndoManager mgr, int offset, int length, String str)
+		//{{{ Replace constructor
+		Replace(int offset, String strRemove, String strInsert)
 		{
-			this.mgr = mgr;
 			this.offset = offset;
-			this.length = length;
-			this.content = new RemovedContent(str);
+			this.strRemove = strRemove;
+			this.strInsert = strInsert;
 		} //}}}
 
 		//{{{ undo() method
-		int undo()
+		@Override
+		Selection[] undo(UndoManager mgr)
 		{
-			mgr.buffer.insert(offset,content.str);
-			if(mgr.undoClearDirty == this)
-				mgr.buffer.setDirty(false);
-			return offset + length;
+			mgr.buffer.remove(offset,strInsert.length());
+			mgr.buffer.insert(offset,strRemove);
+			assert mgr.undoClearDirty != this;
+			return new Selection[] {
+				new Selection.Range(offset, offset + strRemove.length())
+			};
 		} //}}}
 
 		//{{{ redo() method
-		int redo()
+		@Override
+		Selection[] redo(UndoManager mgr)
 		{
-			mgr.buffer.remove(offset,length);
+			mgr.buffer.remove(offset,strRemove.length());
+			mgr.buffer.insert(offset,strInsert);
 			if(mgr.redoClearDirty == this)
 				mgr.buffer.setDirty(false);
-			return offset;
+			int caret = offset + strInsert.length();
+			return new Selection[] { new Selection.Range(caret, caret) };
 		} //}}}
 
-		UndoManager mgr;
 		int offset;
-		int length;
-		final RemovedContent content;
+		String strRemove, strInsert;
+	} //}}}
+
+	//{{{ CompressedReplace class
+	private static class CompressedReplace extends Replace
+	{
+		//{{{ CompressedReplace constructor
+		CompressedReplace(Replace r1)
+		{
+			super(r1.offset, r1.strRemove, r1.strInsert);
+			offsets = new IntegerArray(4);
+			offsets.add(r1.offset);
+		} //}}}
+
+		//{{{ add() method
+		CompressedReplace add(Replace rep)
+		{
+			if(this.strInsert.equals(rep.strInsert) && this.strRemove.equals(rep.strRemove))
+			{
+				offsets.add(rep.offset);
+				return this;
+			}
+			return null;
+		} //}}}
+
+		//{{{ undo() method
+		@Override
+		Selection[] undo(UndoManager mgr)
+		{
+			Selection[] s = null;
+			for(int i = offsets.getSize() - 1; i >= 0; i--)
+			{
+				offset = offsets.get(i);
+				s = super.undo(mgr);
+			}
+			return s;
+		} //}}}
+
+		//{{{ redo() method
+		@Override
+		Selection[] redo(UndoManager mgr)
+		{
+			Selection[] s = null;
+			for(int i = 0; i < offsets.getSize(); i++)
+			{
+				offset = offsets.get(i);
+				s = super.redo(mgr);
+			}
+			return s;
+		} //}}}
+
+		IntegerArray offsets;
 	} //}}}
 
 	//{{{ CompoundEdit class
-	static class CompoundEdit extends Edit
+	private static class CompoundEdit extends Edit
 	{
 		//{{{ undo() method
-		public int undo()
+		@Override
+		public Selection[] undo(UndoManager mgr)
 		{
-			int retVal = -1;
+			Selection[] retVal = null;
 			Edit edit = last;
 			while(edit != null)
 			{
-				retVal = edit.undo();
+				retVal = edit.undo(mgr);
 				edit = edit.prev;
 			}
 			return retVal;
 		} //}}}
 
 		//{{{ redo() method
-		public int redo()
+		@Override
+		public Selection[] redo(UndoManager mgr)
 		{
-			int retVal = -1;
+			Selection[] retVal = null;
 			Edit edit = first;
 			while(edit != null)
 			{
-				retVal = edit.redo();
+				retVal = edit.redo(mgr);
 				edit = edit.next;
 			}
 			return retVal;
 		} //}}}
 
-		//{{{ add() method
-		public void add(Edit edit)
+		//{{{ _add() method
+		private void _add(Edit edit)
 		{
 			if(first == null)
 				first = last = edit;
@@ -495,8 +643,64 @@ public class UndoManager
 			}
 		} //}}}
 
+		//{{{ add() method
+		public void add(UndoManager mgr, Edit edit)
+		{
+			_add(edit);
+
+			// try to compact a sequence of Remove and Insert into a Replace
+			// Edit to save memory for large search&replace operations
+			if(last.prev != null)
+			{
+				Edit rep = mgr.getReplaceFromRemoveInsert(last.prev, last);
+				if(rep != null)
+					exchangeLastElement(rep);
+			}
+
+			// try to compress a sequence of Replace and Replace into a "CompressedReplace"
+			if(last.prev != null)
+			{
+				Edit rep = mgr.getCompressedReplaceFromReplaceReplace(last.prev, last);
+				if(rep != null)
+					exchangeLastElement(rep);
+			}
+			
+			// try to compress a sequence of CompressedReplace and Replace into a "CompressedReplace"
+			if(last.prev != null)
+			{
+				Edit rep = mgr.getCompressedReplaceFromReplaceReplace(last.prev, last);
+				if(rep != null)
+					exchangeLastElement(rep);
+			}
+		} //}}}
+
+		//{{{ exchangeLastElement() method
+		private void exchangeLastElement(Edit edit)
+		{
+			// remove last
+			if(first == last)
+				first = last = null;
+			else
+			{
+				last.prev.next = null;
+				last = last.prev;
+			}
+
+			// exchange current last
+			if(first == null || first == last)
+				first = last = edit;
+			else
+			{
+				edit.prev = last.prev;
+				last.prev.next = edit;
+				last = edit;
+			}
+		} //}}}
+
 		Edit first, last;
 	} //}}}
 
 	//}}}
+
+	//}}}
 }
diff --git a/org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java b/org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
index 7caab2c..24a934c 100644
--- a/org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
+++ b/org/gjt/sp/jedit/bufferio/BufferAutosaveRequest.java
@@ -1,6 +1,6 @@
 /*
  * BufferAutosaveRequest.java - I/O request
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2005 Slava Pestov
@@ -24,6 +24,8 @@ package org.gjt.sp.jedit.bufferio;
 
 //{{{ Imports
 import java.io.*;
+import java.io.Closeable;
+
 import org.gjt.sp.jedit.io.*;
 import org.gjt.sp.jedit.*;
 import org.gjt.sp.util.*;
@@ -32,7 +34,7 @@ import org.gjt.sp.util.*;
 /**
  * A buffer autosave request.
  * @author Slava Pestov
- * @version $Id: BufferAutosaveRequest.java 19408 2011-02-28 14:52:25Z kpouer $
+ * @version $Id: BufferAutosaveRequest.java 22357 2012-10-13 04:58:01Z ezust $
  */
 public class BufferAutosaveRequest extends BufferIORequest
 {
@@ -52,7 +54,7 @@ public class BufferAutosaveRequest extends BufferIORequest
 	} //}}}
 
 	//{{{ run() method
-	public void run()
+	public void _run()
 	{
 		OutputStream out = null;
 
@@ -62,61 +64,59 @@ public class BufferAutosaveRequest extends BufferIORequest
 			setStatus(jEdit.getProperty("vfs.status.autosave",args));
 
 			// the entire save operation can be aborted...
-			setAbortable(true);
+			setCancellable(true);
 
 			try
 			{
-				//buffer.readLock();
-
-				if(!buffer.isDirty())
-				{
-					// buffer has been saved while we
-					// were waiting.
-					return;
-				}
-
-				out = vfs._createOutputStream(session,path,view);
-				if(out == null)
-					return;
-
-				write(buffer,out);
+				buffer.readLock();
+				if(buffer.isDirty())
+					out = vfs._createOutputStream(session,path,view);
+				if(out != null)
+					write(buffer,out);
 			}
 			catch (FileNotFoundException e)
 			{
 				Log.log(Log.WARNING,this,"Unable to save " + e.getMessage());
 			}
+			catch(InterruptedException e)
+			{
+				cleanUpIncomplete(out);
+				Thread.currentThread().interrupt();
+			}
 			catch(Exception e)
 			{
 				Log.log(Log.ERROR,this,e);
 				String[] pp = { e.toString() };
 				VFSManager.error(view,path,"ioerror.write-error",pp);
 
-				// Incomplete autosave file should not exist.
-				if(out != null)
-				{
-					try
-					{
-						out.close();
-						out = null;
-						vfs._delete(session,path,view);
-					}
-					catch(IOException ioe)
-					{
-						Log.log(Log.ERROR,this,ioe);
-					}
-				}
+				cleanUpIncomplete(out);
+			}
+			finally
+			{
+				buffer.readUnlock();
 			}
-			//finally
-			//{
-				//buffer.readUnlock();
-			//}
-		}
-		catch(WorkThread.Abort a)
-		{
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(out);
+			IOUtilities.closeQuietly((Closeable)out);
 		}
 	} //}}}
+
+	private void cleanUpIncomplete(OutputStream out)
+	{
+		// Incomplete autosave file should not exist.
+		if(out != null)
+		{
+			try
+			{
+				out.close();
+				out = null;
+				vfs._delete(session,path,view);
+			}
+			catch(IOException ioe)
+			{
+				Log.log(Log.ERROR,this,ioe);
+			}
+		}
+	}
 }
diff --git a/org/gjt/sp/jedit/bufferio/BufferIORequest.java b/org/gjt/sp/jedit/bufferio/BufferIORequest.java
index 01376ee..53c1679 100644
--- a/org/gjt/sp/jedit/bufferio/BufferIORequest.java
+++ b/org/gjt/sp/jedit/bufferio/BufferIORequest.java
@@ -1,6 +1,6 @@
 /*
  * BufferIORequest.java - I/O request
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2004 Slava Pestov
@@ -44,15 +44,14 @@ import org.gjt.sp.jedit.io.Encoding;
 import org.gjt.sp.jedit.io.EncodingServer;
 import org.gjt.sp.util.IntegerArray;
 import org.gjt.sp.util.SegmentBuffer;
-import org.gjt.sp.util.WorkRequest;
 //}}}
 
 /**
  * A buffer I/O request.
  * @author Slava Pestov
- * @version $Id: BufferIORequest.java 19026 2010-11-26 12:54:56Z kpouer $
+ * @version $Id: BufferIORequest.java 22943 2013-04-22 11:44:40Z thomasmey $
  */
-public abstract class BufferIORequest extends WorkRequest
+public abstract class BufferIORequest extends IoTask
 {
 	//{{{ Constants
 
@@ -97,6 +96,7 @@ public abstract class BufferIORequest extends WorkRequest
 	protected BufferIORequest(View view, Buffer buffer,
 		Object session, VFS vfs, String path)
 	{
+		super();
 		this.view = view;
 		this.buffer = buffer;
 		this.session = session;
@@ -104,6 +104,7 @@ public abstract class BufferIORequest extends WorkRequest
 		this.path = path;
 
 		markersPath = Buffer.getMarkersPath(vfs, path);
+		//buffer.setIoTask(this);
 	} //}}}
 
 	//{{{ toString() method
@@ -143,7 +144,7 @@ public abstract class BufferIORequest extends WorkRequest
 
 	//{{{ read() method
 	protected SegmentBuffer read(Reader in, long length,
-		boolean insert) throws IOException
+		boolean insert) throws IOException, InterruptedException
 	{
 		/* we guess an initial size for the array */
 		IntegerArray endOffsets = new IntegerArray(
@@ -191,6 +192,9 @@ public abstract class BufferIORequest extends WorkRequest
 
 		while((len = in.read(buf,0,buf.length)) != -1)
 		{
+			if(Thread.interrupted())
+				throw new InterruptedException();
+
 			// Offset of previous line, relative to
 			// the start of the I/O buffer (NOT
 			// relative to the start of the document)
@@ -280,7 +284,7 @@ public abstract class BufferIORequest extends WorkRequest
 			seg.append(buf,lastLine,len - lastLine);
 		}
 
-		setAbortable(false);
+		setCancellable(false);
 
 		String lineSeparator;
 		if(seg.count == 0)
@@ -341,7 +345,7 @@ public abstract class BufferIORequest extends WorkRequest
 
 	//{{{ write() method
 	protected void write(Buffer buffer, OutputStream out)
-		throws IOException
+		throws IOException, InterruptedException
 	{
 		String encodingName
 			= buffer.getStringProperty(JEditBuffer.ENCODING);
@@ -361,6 +365,9 @@ public abstract class BufferIORequest extends WorkRequest
 		int i = 0;
 		while(i < bufferLineCount)
 		{
+			if(Thread.interrupted())
+				throw new InterruptedException();
+
 			buffer.getLineText(i,lineSegment);
 			try
 			{
diff --git a/org/gjt/sp/jedit/bufferio/BufferInsertRequest.java b/org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
index 517396a..dc9ec99 100644
--- a/org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
+++ b/org/gjt/sp/jedit/bufferio/BufferInsertRequest.java
@@ -1,6 +1,6 @@
 /*
  * BufferInsertRequest.java - I/O request
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2005 Slava Pestov
@@ -24,6 +24,8 @@ package org.gjt.sp.jedit.bufferio;
 
 //{{{ Imports
 import java.io.*;
+import java.io.Closeable;
+
 import org.gjt.sp.jedit.io.*;
 import org.gjt.sp.jedit.*;
 import org.gjt.sp.util.*;
@@ -32,7 +34,7 @@ import org.gjt.sp.util.*;
 /**
  * A buffer insert request.
  * @author Slava Pestov
- * @version $Id: BufferInsertRequest.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: BufferInsertRequest.java 22357 2012-10-13 04:58:01Z ezust $
  */
 public class BufferInsertRequest extends BufferIORequest
 {
@@ -52,14 +54,14 @@ public class BufferInsertRequest extends BufferIORequest
 	} //}}}
 
 	//{{{ run() method
-	public void run()
+	public void _run()
 	{
 		InputStream in = null;
 		try
 		{
 			String[] args = { vfs.getFileName(path) };
 			setStatus(jEdit.getProperty("vfs.status.load",args));
-			setAbortable(true);
+			setCancellable(true);
 
 			path = vfs._canonPath(session,path,view);
 
@@ -80,7 +82,7 @@ public class BufferInsertRequest extends BufferIORequest
 
 			/* we don't do this in Buffer.insert() so that
 			   we can insert multiple files at once */
-			VFSManager.runInAWTThread(new Runnable()
+			AwtRunnableQueue.INSTANCE.runAfterIoTasks(new Runnable()
 			{
 				public void run()
 				{
@@ -89,6 +91,11 @@ public class BufferInsertRequest extends BufferIORequest
 				}
 			});
 		}
+		catch(InterruptedException e)
+		{
+			buffer.setBooleanProperty(ERROR_OCCURRED,true);
+			Thread.currentThread().interrupt();
+		}
 		catch(Exception e)
 		{
 			Log.log(Log.ERROR,this,e);
@@ -97,13 +104,9 @@ public class BufferInsertRequest extends BufferIORequest
 
 			buffer.setBooleanProperty(ERROR_OCCURRED,true);
 		}
-		catch(WorkThread.Abort a)
-		{
-			buffer.setBooleanProperty(ERROR_OCCURRED,true);
-		}
 		finally
 		{
-			IOUtilities.closeQuietly(in);
+			IOUtilities.closeQuietly((Closeable)in);
 			try
 			{
 				vfs._endVFSSession(session,view);
@@ -116,10 +119,6 @@ public class BufferInsertRequest extends BufferIORequest
 
 				buffer.setBooleanProperty(ERROR_OCCURRED,true);
 			}
-			catch(WorkThread.Abort a)
-			{
-				buffer.setBooleanProperty(ERROR_OCCURRED,true);
-			}
 		}
 	} //}}}
 }
diff --git a/org/gjt/sp/jedit/bufferio/BufferLoadRequest.java b/org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
index 719d503..b5dde4d 100644
--- a/org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
+++ b/org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
@@ -1,6 +1,6 @@
 /*
  * BufferLoadRequest.java - I/O request
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2005 Slava Pestov
@@ -39,7 +39,7 @@ import org.gjt.sp.util.*;
 /**
  * A buffer load request.
  * @author Slava Pestov
- * @version $Id: BufferLoadRequest.java 21594 2012-04-22 11:44:00Z jarekczek $
+ * @version $Id: BufferLoadRequest.java 22357 2012-10-13 04:58:01Z ezust $
  */
 public class BufferLoadRequest extends BufferIORequest
 {
@@ -57,13 +57,13 @@ public class BufferLoadRequest extends BufferIORequest
 	{
 		super(view,buffer,session,vfs,path);
 	} //}}}
-	
+
 	//{{{ run() method
-	public void run()
+	public void _run()
 	{
 		try
 		{
-			setAbortable(true);
+			setCancellable(true);
 			if(!buffer.isTemporary())
 			{
 				String[] args = { vfs.getFileName(path) };
@@ -85,7 +85,7 @@ public class BufferLoadRequest extends BufferIORequest
 					String[] args = { vfs.getFileName(path) };
 					if(!buffer.isTemporary())
 						setStatus(jEdit.getProperty("vfs.status.load-markers",args));
-					setAbortable(true);
+					setCancellable(true);
 
 					markers = vfs._createInputStream(session,markersPath,true,view);
 					if(markers != null)
@@ -101,6 +101,11 @@ public class BufferLoadRequest extends BufferIORequest
 				}
 			}
 		}
+		catch(InterruptedException e)
+		{
+			buffer.setBooleanProperty(ERROR_OCCURRED,true);
+			Thread.currentThread().interrupt();
+		}
 		catch(Exception e)
 		{
 			Log.log(Log.ERROR,this,e);
@@ -116,10 +121,6 @@ public class BufferLoadRequest extends BufferIORequest
 
 			buffer.setBooleanProperty(ERROR_OCCURRED,true);
 		}
-		catch(WorkThread.Abort a)
-		{
-			buffer.setBooleanProperty(ERROR_OCCURRED,true);
-		}
 		finally
 		{
 			try
@@ -134,10 +135,6 @@ public class BufferLoadRequest extends BufferIORequest
 
 				buffer.setBooleanProperty(ERROR_OCCURRED,true);
 			}
-			catch(WorkThread.Abort a)
-			{
-				buffer.setBooleanProperty(ERROR_OCCURRED,true);
-			}
 		}
 	} //}}}
 
@@ -205,7 +202,7 @@ public class BufferLoadRequest extends BufferIORequest
 			}
 			finally
 			{
-				IOUtilities.closeQuietly(in);
+				IOUtilities.closeQuietly((Closeable)in);
 			}
 		}
 	} //}}}
@@ -218,8 +215,9 @@ public class BufferLoadRequest extends BufferIORequest
 	 *   - The encoding
 	 * If fallback encodings are specified, they are used on
 	 * encoding errors.
+	 * @throws InterruptedException
 	 */
-	private void readContents() throws IOException
+	private void readContents() throws IOException, InterruptedException
 	{
 		long length = getContentLength();
 
@@ -357,7 +355,7 @@ public class BufferLoadRequest extends BufferIORequest
 
 	//{{{ readMarkers() method
 	private static void readMarkers(Buffer buffer, InputStream _in)
-		throws IOException
+		throws IOException, InterruptedException
 	{
 		// For `reload' command
 		buffer.removeAllMarkers();
@@ -369,10 +367,13 @@ public class BufferLoadRequest extends BufferIORequest
 			String line;
 			while((line = in.readLine()) != null)
 			{
+				if(Thread.interrupted())
+					throw new InterruptedException();
+
 				// malformed marks file?
 				if(line.length() == 0)
 					continue;
-				
+
 				// compatibility kludge for jEdit 3.1 and earlier
 				if(line.charAt(0) != '!')
 					continue;
diff --git a/org/gjt/sp/jedit/bufferio/BufferSaveRequest.java b/org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
index baf403b..72cb61a 100644
--- a/org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
+++ b/org/gjt/sp/jedit/bufferio/BufferSaveRequest.java
@@ -1,6 +1,6 @@
 /*
  * BufferSaveRequest.java - I/O request
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2005 Slava Pestov
@@ -24,6 +24,7 @@ package org.gjt.sp.jedit.bufferio;
 
 //{{{ Imports
 import java.io.*;
+import java.io.Closeable;
 import java.util.zip.*;
 
 import org.gjt.sp.jedit.io.*;
@@ -35,7 +36,7 @@ import java.nio.charset.UnsupportedCharsetException;
 /**
  * A buffer save request.
  * @author Slava Pestov
- * @version $Id: BufferSaveRequest.java 22385 2012-10-15 03:59:45Z ezust $
+ * @version $Id: BufferSaveRequest.java 22357 2012-10-13 04:58:01Z ezust $
  */
 public class BufferSaveRequest extends BufferIORequest
 {
@@ -55,7 +56,7 @@ public class BufferSaveRequest extends BufferIORequest
 	} //}}}
 
 	//{{{ run() method
-	public void run()
+	public void _run()
 	{
 		/* if the VFS supports renaming files, we first
 		 * save to #<filename>#save#, then rename that
@@ -79,7 +80,7 @@ public class BufferSaveRequest extends BufferIORequest
 			setStatus(jEdit.getProperty("vfs.status.save",args));
 
 			// the entire save operation can be aborted...
-			setAbortable(true);
+			setCancellable(true);
 
 			path = vfs._canonPath(session,path,view);
 			if(!MiscUtilities.isURL(path))
@@ -139,9 +140,14 @@ public class BufferSaveRequest extends BufferIORequest
 					buffer.readUnlock();
 				}
 			}
+			catch(InterruptedException e)
+			{
+				buffer.setBooleanProperty(ERROR_OCCURRED,true);
+				Thread.currentThread().interrupt();
+			}
 			finally
 			{
-				IOUtilities.closeQuietly(out);
+				IOUtilities.closeQuietly((Closeable)out);
 			}
 
 			if(twoStageSave)
@@ -178,10 +184,6 @@ public class BufferSaveRequest extends BufferIORequest
 
 			buffer.setBooleanProperty(ERROR_OCCURRED,true);
 		}
-		catch(WorkThread.Abort a)
-		{
-			buffer.setBooleanProperty(ERROR_OCCURRED,true);
-		}
 		finally
 		{
 			try
@@ -204,10 +206,6 @@ public class BufferSaveRequest extends BufferIORequest
 
 				buffer.setBooleanProperty(ERROR_OCCURRED,true);
 			}
-			catch(WorkThread.Abort a)
-			{
-				buffer.setBooleanProperty(ERROR_OCCURRED,true);
-			}
 		}
 	} //}}}
 
diff --git a/org/gjt/sp/jedit/bufferio/IoTask.java b/org/gjt/sp/jedit/bufferio/IoTask.java
new file mode 100644
index 0000000..1d9af00
--- /dev/null
+++ b/org/gjt/sp/jedit/bufferio/IoTask.java
@@ -0,0 +1,7 @@
+package org.gjt.sp.jedit.bufferio;
+
+import org.gjt.sp.util.Task;
+
+public abstract class IoTask extends Task
+{
+}
diff --git a/org/gjt/sp/jedit/bufferio/MarkersSaveRequest.java b/org/gjt/sp/jedit/bufferio/MarkersSaveRequest.java
index 3a76551..0a11fbd 100644
--- a/org/gjt/sp/jedit/bufferio/MarkersSaveRequest.java
+++ b/org/gjt/sp/jedit/bufferio/MarkersSaveRequest.java
@@ -1,5 +1,5 @@
 /* {{{ MarkersSaveRequest.java - I/O request
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * based on jEdit.buffer.BufferSaveRequest (Copyright (C) 2000, 2005 Slava Pestov)
@@ -97,7 +97,7 @@ public class MarkersSaveRequest extends Task
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(out);
+			IOUtilities.closeQuietly((Closeable)out);
 		}
 	} //}}}
 
diff --git a/org/gjt/sp/jedit/bufferset/BufferSet.java b/org/gjt/sp/jedit/bufferset/BufferSet.java
index f46a854..e151a9d 100644
--- a/org/gjt/sp/jedit/bufferset/BufferSet.java
+++ b/org/gjt/sp/jedit/bufferset/BufferSet.java
@@ -1,6 +1,6 @@
 /*
  * BufferSet.java - An ordered list of buffers.
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008, 2010 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/bufferset/BufferSetAdapter.java b/org/gjt/sp/jedit/bufferset/BufferSetAdapter.java
index 36cd4fb..ac8aef0 100644
--- a/org/gjt/sp/jedit/bufferset/BufferSetAdapter.java
+++ b/org/gjt/sp/jedit/bufferset/BufferSetAdapter.java
@@ -1,6 +1,6 @@
 /*
  * BufferSetAdapter.java - the default implementation for the bufferSet listener
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/bufferset/BufferSetListener.java b/org/gjt/sp/jedit/bufferset/BufferSetListener.java
index e056b1a..93e3124 100644
--- a/org/gjt/sp/jedit/bufferset/BufferSetListener.java
+++ b/org/gjt/sp/jedit/bufferset/BufferSetListener.java
@@ -1,6 +1,6 @@
 /*
  * BufferSetListener.java - the listener for buffersets change
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/bufferset/BufferSetManager.java b/org/gjt/sp/jedit/bufferset/BufferSetManager.java
index a28b7ef..4ad4a70 100644
--- a/org/gjt/sp/jedit/bufferset/BufferSetManager.java
+++ b/org/gjt/sp/jedit/bufferset/BufferSetManager.java
@@ -1,6 +1,6 @@
 /*
  * BufferSetManager.java - Manages the buffersets.
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008, 2010 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/datatransfer/JEditDataFlavor.java b/org/gjt/sp/jedit/datatransfer/JEditDataFlavor.java
index e1a28ff..5fcede4 100644
--- a/org/gjt/sp/jedit/datatransfer/JEditDataFlavor.java
+++ b/org/gjt/sp/jedit/datatransfer/JEditDataFlavor.java
@@ -1,35 +1,35 @@
-/*
- * JEditDataFlavor.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.datatransfer;
-
-import java.awt.datatransfer.DataFlavor;
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 4.4.x
- */
-public class JEditDataFlavor
-{
-	public static final DataFlavor jEditRichTextDataFlavor = new DataFlavor(JEditRichText.class, DataFlavor.javaJVMLocalObjectMimeType);
-	public static final DataFlavor html = new DataFlavor("text/html; class=java.lang.String", "text/html");
-}
+/*
+ * JEditDataFlavor.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.datatransfer;
+
+import java.awt.datatransfer.DataFlavor;
+
+/**
+ * @author Matthieu Casanova
+ * @since jEdit 4.4.x
+ */
+public class JEditDataFlavor
+{
+	public static final DataFlavor jEditRichTextDataFlavor = new DataFlavor(JEditRichText.class, DataFlavor.javaJVMLocalObjectMimeType);
+	public static final DataFlavor html = new DataFlavor("text/html; class=java.lang.String", "text/html");
+}
diff --git a/org/gjt/sp/jedit/datatransfer/JEditRichText.java b/org/gjt/sp/jedit/datatransfer/JEditRichText.java
index 739c839..8af02ef 100644
--- a/org/gjt/sp/jedit/datatransfer/JEditRichText.java
+++ b/org/gjt/sp/jedit/datatransfer/JEditRichText.java
@@ -1,58 +1,58 @@
-/*
- * JEditRichText.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.datatransfer;
-
-import org.gjt.sp.jedit.Mode;
-import org.gjt.sp.jedit.syntax.ModeProvider;
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 4.4.x
- */
-public class JEditRichText
-{
-	private final String text;
-
-	private final String mode;
-
-	public JEditRichText(String text, String mode)
-	{
-		this.text = text;
-		this.mode = mode;
-	}
-
-	public String getText()
-	{
-		return text;
-	}
-
-	public Mode getMode()
-	{
-		return ModeProvider.instance.getMode(mode);
-	}
-
-	@Override
-	public String toString()
-	{
-		return text;
-	}
-}
+/*
+ * JEditRichText.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.datatransfer;
+
+import org.gjt.sp.jedit.Mode;
+import org.gjt.sp.jedit.syntax.ModeProvider;
+
+/**
+ * @author Matthieu Casanova
+ * @since jEdit 4.4.x
+ */
+public class JEditRichText
+{
+	private final String text;
+
+	private final String mode;
+
+	public JEditRichText(String text, String mode)
+	{
+		this.text = text;
+		this.mode = mode;
+	}
+
+	public String getText()
+	{
+		return text;
+	}
+
+	public Mode getMode()
+	{
+		return ModeProvider.instance.getMode(mode);
+	}
+
+	@Override
+	public String toString()
+	{
+		return text;
+	}
+}
diff --git a/org/gjt/sp/jedit/datatransfer/JEditTransferable.java b/org/gjt/sp/jedit/datatransfer/JEditTransferable.java
index 1420d1a..fa62a2b 100644
--- a/org/gjt/sp/jedit/datatransfer/JEditTransferable.java
+++ b/org/gjt/sp/jedit/datatransfer/JEditTransferable.java
@@ -1,61 +1,61 @@
-/*
- * JEditTransferable.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.datatransfer;
-
-import java.awt.datatransfer.*;
-import java.io.IOException;
-import java.util.Map;
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 4.4.x
- */
-public class JEditTransferable implements Transferable
-{
-	private final DataFlavor[] dataFlavors;
-
-	private final Map<DataFlavor, Transferable> flavors;
-
-	public JEditTransferable(Map<DataFlavor, Transferable> flavors)
-	{
-		this.flavors = flavors;
-		dataFlavors = flavors.keySet().toArray(new DataFlavor[flavors.size()]);
-	}
-
-	public DataFlavor[] getTransferDataFlavors()
-	{
-		return dataFlavors;
-	}
-
-	public boolean isDataFlavorSupported(DataFlavor flavor)
-	{
-		return flavors.containsKey(flavor);
-	}
-
-	public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
-	{
-		if (!isDataFlavorSupported(flavor))
-			throw new UnsupportedFlavorException(flavor);
-		Transferable transferable = flavors.get(flavor);
-		return transferable.getTransferData(flavor);
-	}
-}
+/*
+ * JEditTransferable.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.datatransfer;
+
+import java.awt.datatransfer.*;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * @author Matthieu Casanova
+ * @since jEdit 4.4.x
+ */
+public class JEditTransferable implements Transferable
+{
+	private final DataFlavor[] dataFlavors;
+
+	private final Map<DataFlavor, Transferable> flavors;
+
+	public JEditTransferable(Map<DataFlavor, Transferable> flavors)
+	{
+		this.flavors = flavors;
+		dataFlavors = flavors.keySet().toArray(new DataFlavor[flavors.size()]);
+	}
+
+	public DataFlavor[] getTransferDataFlavors()
+	{
+		return dataFlavors;
+	}
+
+	public boolean isDataFlavorSupported(DataFlavor flavor)
+	{
+		return flavors.containsKey(flavor);
+	}
+
+	public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
+	{
+		if (!isDataFlavorSupported(flavor))
+			throw new UnsupportedFlavorException(flavor);
+		Transferable transferable = flavors.get(flavor);
+		return transferable.getTransferData(flavor);
+	}
+}
diff --git a/org/gjt/sp/jedit/datatransfer/JEditTransferableService.java b/org/gjt/sp/jedit/datatransfer/JEditTransferableService.java
index 253ac22..e9bc9de 100644
--- a/org/gjt/sp/jedit/datatransfer/JEditTransferableService.java
+++ b/org/gjt/sp/jedit/datatransfer/JEditTransferableService.java
@@ -1,36 +1,36 @@
-/*
- * JEditTransferableService.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.datatransfer;
-
-import org.gjt.sp.jedit.textarea.TextArea;
-
-import java.awt.datatransfer.Transferable;
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 4.4.x
- */
-public interface JEditTransferableService
-{
-	boolean accept(TextArea textArea, String text);
-	Transferable getTransferable(TextArea textArea, String text);
-}
+/*
+ * JEditTransferableService.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.datatransfer;
+
+import org.gjt.sp.jedit.textarea.TextArea;
+
+import java.awt.datatransfer.Transferable;
+
+/**
+ * @author Matthieu Casanova
+ * @since jEdit 4.4.x
+ */
+public interface JEditTransferableService
+{
+	boolean accept(TextArea textArea, String text);
+	Transferable getTransferable(TextArea textArea, String text);
+}
diff --git a/org/gjt/sp/jedit/datatransfer/ListVFSFileTransferable.java b/org/gjt/sp/jedit/datatransfer/ListVFSFileTransferable.java
index fc9f715..499b4da 100644
--- a/org/gjt/sp/jedit/datatransfer/ListVFSFileTransferable.java
+++ b/org/gjt/sp/jedit/datatransfer/ListVFSFileTransferable.java
@@ -1,99 +1,99 @@
-/*
- * ListVFSFileTransferable.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010, 2012 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.datatransfer;
-
-//{{{ Imports
-import org.gjt.sp.jedit.io.FileVFS;
-import org.gjt.sp.jedit.io.VFSFile;
-
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-//}}}
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 4.4.x
- */
-public class ListVFSFileTransferable implements Transferable
-{
-	public static final DataFlavor jEditFileList = new DataFlavor(List.class, "application/x-java-jEdit-list-vfsfile");
-	public static final DataFlavor[] supported = {jEditFileList, DataFlavor.stringFlavor, DataFlavor.javaFileListFlavor};
-	
-	private final List<VFSFile> files;
-
-	//{{{ ListVFSFileTransferable constructor
-	public ListVFSFileTransferable(VFSFile[] files)
-	{
-		this.files = Collections.unmodifiableList(Arrays.asList(files));
-	} //}}}
-
-	//{{{ getTransferDataFlavors() method
-	public DataFlavor[] getTransferDataFlavors()
-	{
-		return supported;
-	} //}}}
-
-	//{{{ isDataFlavorSupported() method
-	public boolean isDataFlavorSupported(DataFlavor flavor)
-	{
-		return jEditFileList.equals(flavor) || DataFlavor.stringFlavor.equals(flavor);
-	} //}}}
-
-	//{{{ getTransferData() method
-	public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
-	{
-		if (jEditFileList.equals(flavor))
-		{
-			return files;
-		}
-		else if (DataFlavor.stringFlavor.equals(flavor))
-		{
-			StringBuilder builder = new StringBuilder();
-			for (int i = 0; i < files.size(); i++)
-			{
-				VFSFile vfsFile = files.get(i);
-				if (i != 0)
-					builder.append('\n');
-				builder.append(vfsFile.getPath());
-			}
-			return builder.toString();
-		}
-		else if (DataFlavor.javaFileListFlavor.equals(flavor))
-		{
-			List<File> files = new ArrayList<File>(this.files.size());
-			for (VFSFile file : this.files)
-			{
-				if (file.getVFS() instanceof FileVFS)
-					files.add(new File(file.getPath()));
-			}
-			return files;
-		}
-		throw new UnsupportedFlavorException(flavor);
-	} //}}}
-}
+/*
+ * ListVFSFileTransferable.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010, 2012 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.datatransfer;
+
+//{{{ Imports
+import org.gjt.sp.jedit.io.FileVFS;
+import org.gjt.sp.jedit.io.VFSFile;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+//}}}
+
+/**
+ * @author Matthieu Casanova
+ * @since jEdit 4.4.x
+ */
+public class ListVFSFileTransferable implements Transferable
+{
+	public static final DataFlavor jEditFileList = new DataFlavor(List.class, "application/x-java-jEdit-list-vfsfile");
+	public static final DataFlavor[] supported = {jEditFileList, DataFlavor.stringFlavor, DataFlavor.javaFileListFlavor};
+	
+	private final List<VFSFile> files;
+
+	//{{{ ListVFSFileTransferable constructor
+	public ListVFSFileTransferable(VFSFile[] files)
+	{
+		this.files = Collections.unmodifiableList(Arrays.asList(files));
+	} //}}}
+
+	//{{{ getTransferDataFlavors() method
+	public DataFlavor[] getTransferDataFlavors()
+	{
+		return supported;
+	} //}}}
+
+	//{{{ isDataFlavorSupported() method
+	public boolean isDataFlavorSupported(DataFlavor flavor)
+	{
+		return jEditFileList.equals(flavor) || DataFlavor.stringFlavor.equals(flavor);
+	} //}}}
+
+	//{{{ getTransferData() method
+	public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
+	{
+		if (jEditFileList.equals(flavor))
+		{
+			return files;
+		}
+		else if (DataFlavor.stringFlavor.equals(flavor))
+		{
+			StringBuilder builder = new StringBuilder();
+			for (int i = 0; i < files.size(); i++)
+			{
+				VFSFile vfsFile = files.get(i);
+				if (i != 0)
+					builder.append('\n');
+				builder.append(vfsFile.getPath());
+			}
+			return builder.toString();
+		}
+		else if (DataFlavor.javaFileListFlavor.equals(flavor))
+		{
+			List<File> files = new ArrayList<File>(this.files.size());
+			for (VFSFile file : this.files)
+			{
+				if (file.getVFS() instanceof FileVFS)
+					files.add(new File(file.getPath()));
+			}
+			return files;
+		}
+		throw new UnsupportedFlavorException(flavor);
+	} //}}}
+}
diff --git a/org/gjt/sp/jedit/datatransfer/RichJEditTextTransferableService.java b/org/gjt/sp/jedit/datatransfer/RichJEditTextTransferableService.java
index e1f8faa..d489066 100644
--- a/org/gjt/sp/jedit/datatransfer/RichJEditTextTransferableService.java
+++ b/org/gjt/sp/jedit/datatransfer/RichJEditTextTransferableService.java
@@ -1,43 +1,43 @@
-/*
- * RichJEditTextTransferableService.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.datatransfer;
-
-import org.gjt.sp.jedit.textarea.TextArea;
-
-import java.awt.datatransfer.Transferable;
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 4.4.x
- */
-public class RichJEditTextTransferableService implements JEditTransferableService
-{
-	public boolean accept(TextArea textArea, String text)
-	{
-		return textArea != null;
-	}
-
-	public Transferable getTransferable(TextArea textArea, String text)
-	{
-		return new RichTextTransferable(text, textArea.getBuffer().getMode().getName());
-	}
-}
+/*
+ * RichJEditTextTransferableService.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.datatransfer;
+
+import org.gjt.sp.jedit.textarea.TextArea;
+
+import java.awt.datatransfer.Transferable;
+
+/**
+ * @author Matthieu Casanova
+ * @since jEdit 4.4.x
+ */
+public class RichJEditTextTransferableService implements JEditTransferableService
+{
+	public boolean accept(TextArea textArea, String text)
+	{
+		return textArea != null;
+	}
+
+	public Transferable getTransferable(TextArea textArea, String text)
+	{
+		return new RichTextTransferable(text, textArea.getBuffer().getMode().getName());
+	}
+}
diff --git a/org/gjt/sp/jedit/datatransfer/RichTextTransferable.java b/org/gjt/sp/jedit/datatransfer/RichTextTransferable.java
index a42682f..5cc0cf9 100644
--- a/org/gjt/sp/jedit/datatransfer/RichTextTransferable.java
+++ b/org/gjt/sp/jedit/datatransfer/RichTextTransferable.java
@@ -1,62 +1,62 @@
-/*
- * RichTextTransferable.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.datatransfer;
-
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.io.IOException;
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 4.4.x
- */
-public class RichTextTransferable implements Transferable
-{
-	private static final DataFlavor[] supportedDataFlavor = {JEditDataFlavor.jEditRichTextDataFlavor};
-
-	private final String text;
-	private final String mode;
-
-	public RichTextTransferable(String text, String mode)
-	{
-		this.text = text;
-		this.mode = mode;
-	}
-
-	public DataFlavor[] getTransferDataFlavors()
-	{
-		return supportedDataFlavor;
-	}
-
-	public boolean isDataFlavorSupported(DataFlavor flavor)
-	{
-		return JEditDataFlavor.jEditRichTextDataFlavor.equals(flavor);
-	}
-
-	public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
-	{
-		if (!isDataFlavorSupported(flavor))
-			throw new UnsupportedFlavorException(flavor);
-		return new JEditRichText(text, mode);
-	}
-}
+/*
+ * RichTextTransferable.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.datatransfer;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+
+/**
+ * @author Matthieu Casanova
+ * @since jEdit 4.4.x
+ */
+public class RichTextTransferable implements Transferable
+{
+	private static final DataFlavor[] supportedDataFlavor = {JEditDataFlavor.jEditRichTextDataFlavor};
+
+	private final String text;
+	private final String mode;
+
+	public RichTextTransferable(String text, String mode)
+	{
+		this.text = text;
+		this.mode = mode;
+	}
+
+	public DataFlavor[] getTransferDataFlavors()
+	{
+		return supportedDataFlavor;
+	}
+
+	public boolean isDataFlavorSupported(DataFlavor flavor)
+	{
+		return JEditDataFlavor.jEditRichTextDataFlavor.equals(flavor);
+	}
+
+	public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
+	{
+		if (!isDataFlavorSupported(flavor))
+			throw new UnsupportedFlavorException(flavor);
+		return new JEditRichText(text, mode);
+	}
+}
diff --git a/org/gjt/sp/jedit/datatransfer/StringTransferableService.java b/org/gjt/sp/jedit/datatransfer/StringTransferableService.java
index 1afd57d..035364f 100644
--- a/org/gjt/sp/jedit/datatransfer/StringTransferableService.java
+++ b/org/gjt/sp/jedit/datatransfer/StringTransferableService.java
@@ -1,43 +1,43 @@
-/*
- * StringTransferableService.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.datatransfer;
-
-import org.gjt.sp.jedit.textarea.TextArea;
-
-import java.awt.datatransfer.*;
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 4.4.x
- */
-public class StringTransferableService implements JEditTransferableService
-{
-	public boolean accept(TextArea textArea, String text)
-	{
-		return true;
-	}
-
-	public Transferable getTransferable(TextArea textArea, String text)
-	{
-		return new StringSelection(text);
-	}
-}
+/*
+ * StringTransferableService.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.datatransfer;
+
+import org.gjt.sp.jedit.textarea.TextArea;
+
+import java.awt.datatransfer.*;
+
+/**
+ * @author Matthieu Casanova
+ * @since jEdit 4.4.x
+ */
+public class StringTransferableService implements JEditTransferableService
+{
+	public boolean accept(TextArea textArea, String text)
+	{
+		return true;
+	}
+
+	public Transferable getTransferable(TextArea textArea, String text)
+	{
+		return new StringSelection(text);
+	}
+}
diff --git a/org/gjt/sp/jedit/datatransfer/TransferHandler.java b/org/gjt/sp/jedit/datatransfer/TransferHandler.java
index aab81b0..042c0f0 100644
--- a/org/gjt/sp/jedit/datatransfer/TransferHandler.java
+++ b/org/gjt/sp/jedit/datatransfer/TransferHandler.java
@@ -1,78 +1,78 @@
-/*
- * TransferHandler.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.datatransfer;
-
-import org.gjt.sp.jedit.textarea.TextArea;
-
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 4.4.x
- */
-public class TransferHandler
-{
-	private static final TransferHandler instance = new TransferHandler();
-
-	private final List<JEditTransferableService> services;
-
-	private TransferHandler()
-	{
-		services = new ArrayList<JEditTransferableService>();
-	}
-
-	public static TransferHandler getInstance()
-	{
-		return instance;
-	}
-
-	public void registerTransferableService(JEditTransferableService transferableService)
-	{
-		if (!services.contains(transferableService))
-			services.add(transferableService);
-	}
-
-	public Transferable getTransferable(TextArea textArea, String text)
-	{
-		Map<DataFlavor, Transferable> flavors = new HashMap<DataFlavor, Transferable>();
-		for (JEditTransferableService service : services)
-		{
-			if (service.accept(textArea, text))
-			{
-				Transferable t = service.getTransferable(textArea, text);
-				DataFlavor[] supportedDataFlavor = t.getTransferDataFlavors();
-				for (DataFlavor dataFlavor : supportedDataFlavor)
-				{
-					flavors.put(dataFlavor, t);
-				}
-			}
-		}
-		 Transferable transferable = new JEditTransferable(flavors);
-
-		return transferable;
-	}
-}
+/*
+ * TransferHandler.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.datatransfer;
+
+import org.gjt.sp.jedit.textarea.TextArea;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Matthieu Casanova
+ * @since jEdit 4.4.x
+ */
+public class TransferHandler
+{
+	private static final TransferHandler instance = new TransferHandler();
+
+	private final List<JEditTransferableService> services;
+
+	private TransferHandler()
+	{
+		services = new ArrayList<JEditTransferableService>();
+	}
+
+	public static TransferHandler getInstance()
+	{
+		return instance;
+	}
+
+	public void registerTransferableService(JEditTransferableService transferableService)
+	{
+		if (!services.contains(transferableService))
+			services.add(transferableService);
+	}
+
+	public Transferable getTransferable(TextArea textArea, String text)
+	{
+		Map<DataFlavor, Transferable> flavors = new HashMap<DataFlavor, Transferable>();
+		for (JEditTransferableService service : services)
+		{
+			if (service.accept(textArea, text))
+			{
+				Transferable t = service.getTransferable(textArea, text);
+				DataFlavor[] supportedDataFlavor = t.getTransferDataFlavors();
+				for (DataFlavor dataFlavor : supportedDataFlavor)
+				{
+					flavors.put(dataFlavor, t);
+				}
+			}
+		}
+		 Transferable transferable = new JEditTransferable(flavors);
+
+		return transferable;
+	}
+}
diff --git a/org/gjt/sp/jedit/default.abbrevs b/org/gjt/sp/jedit/default.abbrevs
index f3ac0f6..b5d86fc 100644
--- a/org/gjt/sp/jedit/default.abbrevs
+++ b/org/gjt/sp/jedit/default.abbrevs
@@ -1,10 +1,13 @@
+; Default set of abbreviations for jEdit.
+; :mode=ini:encoding=UTF-8:
 [global]
+--|—
 alpha|α
 beta|β
 gamma|γ
 delta|δ
 epsilon|ε
-zeta|ζ 
+zeta|ζ
 eta|η
 theta|ϴ
 iota|ι
@@ -34,8 +37,6 @@ Upsilon|Υ
 Phi|Φ
 Psi|Ψ
 Omega|Ω
-
-
 pm|±
 mp|∓
 times|
@@ -132,7 +133,6 @@ Rightarrow|⇒
 leftrightarrow|↔
 <->|↔
 mapsto|↦
-|->|↦
 uparrow|↑
 hookleftarrow|↪
 c->|↪
@@ -151,7 +151,6 @@ nwarrow|↖
 downarrow|↓
 uparrow|↑
 updownarrow|↕
-
 Downarrow|⇓
 Uparrow|⇑
 Updownarrow|⇳
@@ -196,12 +195,10 @@ oo|ø
 OO|Ø
 ss|ß
 ??|¿
-
 lfloor|⎣
 rfloor|⎦
 lceil|⎡
 rceil|⎤
-backslash|\
 
 [java]
 Br|BufferedReader $1 = new BufferedReader(\|);
diff --git a/org/gjt/sp/jedit/gui/AbbrevEditor.java b/org/gjt/sp/jedit/gui/AbbrevEditor.java
index 4bf31a7..3a420fb 100644
--- a/org/gjt/sp/jedit/gui/AbbrevEditor.java
+++ b/org/gjt/sp/jedit/gui/AbbrevEditor.java
@@ -1,6 +1,6 @@
 /*
  * AbbrevEditor.java - Panel for editing abbreviations
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/AboutDialog.java b/org/gjt/sp/jedit/gui/AboutDialog.java
index 37be908..5311565 100644
--- a/org/gjt/sp/jedit/gui/AboutDialog.java
+++ b/org/gjt/sp/jedit/gui/AboutDialog.java
@@ -1,6 +1,6 @@
 /*
  * AboutDialog.java - About jEdit dialog box
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2001, 2002 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/AbstractContextOptionPane.java b/org/gjt/sp/jedit/gui/AbstractContextOptionPane.java
index cec878b..e6747d1 100644
--- a/org/gjt/sp/jedit/gui/AbstractContextOptionPane.java
+++ b/org/gjt/sp/jedit/gui/AbstractContextOptionPane.java
@@ -38,7 +38,7 @@ import org.gjt.sp.util.StandardUtilities;
  *
  * @author Slava Pestov
  * @author Marcelo Vanzin
- * @version $Id: AbstractContextOptionPane.java 21983 2012-08-07 15:29:11Z ezust $
+ * @version $Id: AbstractContextOptionPane.java 21981 2012-08-06 19:19:16Z jarekczek $
  * @since jEdit 4.3pre13
  */
 public abstract class AbstractContextOptionPane extends AbstractOptionPane
diff --git a/org/gjt/sp/jedit/gui/ActionBar.java b/org/gjt/sp/jedit/gui/ActionBar.java
index dc3523b..3cabfe8 100644
--- a/org/gjt/sp/jedit/gui/ActionBar.java
+++ b/org/gjt/sp/jedit/gui/ActionBar.java
@@ -1,6 +1,6 @@
 /*
  * ActionBar.java - For invoking actions directly
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/AnimatedIcon.java b/org/gjt/sp/jedit/gui/AnimatedIcon.java
index 47723b9..73fbf2b 100644
--- a/org/gjt/sp/jedit/gui/AnimatedIcon.java
+++ b/org/gjt/sp/jedit/gui/AnimatedIcon.java
@@ -1,6 +1,6 @@
 /*
  * AnimatedIcon.java - Animated version of ImageIcon
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Kris Kopicki
diff --git a/org/gjt/sp/jedit/gui/BeanShellErrorDialog.java b/org/gjt/sp/jedit/gui/BeanShellErrorDialog.java
index 7390d9d..505744c 100644
--- a/org/gjt/sp/jedit/gui/BeanShellErrorDialog.java
+++ b/org/gjt/sp/jedit/gui/BeanShellErrorDialog.java
@@ -1,6 +1,6 @@
 /*
  * BeanShellErrorDialog.java - BeanShell execution error dialog box
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001 Slava Pestov
@@ -31,7 +31,7 @@ import org.gjt.sp.jedit.*;
 
 /** A dialog box showing a stack trace. Perhaps badly named, since any error, not just a BeanShell error can be shown.
  * @author Slava Pestov
- * @version $Id: BeanShellErrorDialog.java 21502 2012-03-29 17:19:44Z ezust $
+ * @version $Id: BeanShellErrorDialog.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class BeanShellErrorDialog extends TextAreaDialog
 {
diff --git a/org/gjt/sp/jedit/gui/BufferOptions.java b/org/gjt/sp/jedit/gui/BufferOptions.java
index 279b6f2..d6bcd5f 100644
--- a/org/gjt/sp/jedit/gui/BufferOptions.java
+++ b/org/gjt/sp/jedit/gui/BufferOptions.java
@@ -1,6 +1,6 @@
 /*
  * BufferOptions.java - Buffer-specific options dialog
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2004 Slava Pestov
@@ -42,7 +42,7 @@ import org.gjt.sp.jedit.*;
 
 /** Buffer-specific options dialog.
  * @author Slava Pestov
- * @version $Id: BufferOptions.java 21502 2012-03-29 17:19:44Z ezust $
+ * @version $Id: BufferOptions.java 21831 2012-06-18 22:54:17Z ezust $
  *
  */
 
diff --git a/org/gjt/sp/jedit/gui/BufferSwitcher.java b/org/gjt/sp/jedit/gui/BufferSwitcher.java
index bc0f100..4d0a793 100644
--- a/org/gjt/sp/jedit/gui/BufferSwitcher.java
+++ b/org/gjt/sp/jedit/gui/BufferSwitcher.java
@@ -22,7 +22,6 @@ package org.gjt.sp.jedit.gui;
 //{{{ Imports
 import javax.swing.event.*;
 import javax.swing.*;
-import java.awt.event.*;
 import java.awt.*;
 import org.gjt.sp.jedit.*;
 import org.gjt.sp.jedit.bufferset.BufferSet;
@@ -30,7 +29,7 @@ import org.gjt.sp.util.ThreadUtilities;
 //}}}
 
 /** BufferSwitcher class
-   @version $Id: BufferSwitcher.java 20764 2012-01-12 21:05:23Z jarekczek $
+   @version $Id: BufferSwitcher.java 22075 2012-08-26 23:13:58Z ezust $
 */
 public class BufferSwitcher extends JComboBox
 {
@@ -46,7 +45,7 @@ public class BufferSwitcher extends JComboBox
 
 		//setFont(new Font("Dialog",Font.BOLD,10));
 		setRenderer(new BufferCellRenderer());
-		setMaximumRowCount(jEdit.getIntegerProperty("bufferSwitcher.maxRowCount",10));
+		setMaximumRowCount(jEdit.getIntegerProperty("bufferSwitcher.maxRowCount", 10));
 		addPopupMenuListener(new PopupMenuListener()
 		{
 			@Override
diff --git a/org/gjt/sp/jedit/gui/CloseDialog.java b/org/gjt/sp/jedit/gui/CloseDialog.java
index 09e180c..b012e32 100644
--- a/org/gjt/sp/jedit/gui/CloseDialog.java
+++ b/org/gjt/sp/jedit/gui/CloseDialog.java
@@ -1,6 +1,6 @@
 /*
  * CloseDialog.java - Close all buffers dialog
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2000 Slava Pestov
@@ -34,6 +34,7 @@ import org.gjt.sp.jedit.bufferio.BufferIORequest;
 import org.gjt.sp.jedit.io.*;
 import org.gjt.sp.jedit.*;
 import org.gjt.sp.util.Log;
+import org.gjt.sp.util.TaskManager;
 //}}}
 
 /** Close all buffers dialog
@@ -183,7 +184,7 @@ public class CloseDialog extends EnhancedDialog
 					Buffer buffer = jEdit.getBuffer(path);
 					if(!buffer.save(view,null,true,true))
 						return;
-					VFSManager.waitForRequests();
+					TaskManager.instance.waitForIoTasks();
 					if(buffer.getBooleanProperty(BufferIORequest
 						.ERROR_OCCURRED))
 						return;
diff --git a/org/gjt/sp/jedit/gui/ColorWellButton.java b/org/gjt/sp/jedit/gui/ColorWellButton.java
index 5928add..ecd8128 100644
--- a/org/gjt/sp/jedit/gui/ColorWellButton.java
+++ b/org/gjt/sp/jedit/gui/ColorWellButton.java
@@ -1,6 +1,6 @@
 /*
  * ColorWellButton.java - Shows color chooser when clicked
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Slava Pestov
@@ -36,7 +36,7 @@ import org.gjt.sp.jedit.OperatingSystem;
  * You can get and set the currently selected color using
  * {@link #getSelectedColor()} and {@link #setSelectedColor(Color)}.
  * @author Slava Pestov
- * @version $Id: ColorWellButton.java 21502 2012-03-29 17:19:44Z ezust $
+ * @version $Id: ColorWellButton.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class ColorWellButton extends JButton
 {
diff --git a/org/gjt/sp/jedit/gui/CompleteWord.java b/org/gjt/sp/jedit/gui/CompleteWord.java
index 0ac5f67..c707033 100644
--- a/org/gjt/sp/jedit/gui/CompleteWord.java
+++ b/org/gjt/sp/jedit/gui/CompleteWord.java
@@ -1,6 +1,6 @@
 /*
  * CompleteWord.java - Complete word dialog
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2001 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/CompletionPopup.java b/org/gjt/sp/jedit/gui/CompletionPopup.java
index c4cfb0a..ed57b60 100644
--- a/org/gjt/sp/jedit/gui/CompletionPopup.java
+++ b/org/gjt/sp/jedit/gui/CompletionPopup.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 KazutoshiSatoda
diff --git a/org/gjt/sp/jedit/gui/ContextAddDialog.java b/org/gjt/sp/jedit/gui/ContextAddDialog.java
index e55a578..dee30e4 100644
--- a/org/gjt/sp/jedit/gui/ContextAddDialog.java
+++ b/org/gjt/sp/jedit/gui/ContextAddDialog.java
@@ -1,6 +1,6 @@
 /*
  * ContextAddDialog.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Marcelo Vancin
diff --git a/org/gjt/sp/jedit/gui/DefaultFocusComponent.java b/org/gjt/sp/jedit/gui/DefaultFocusComponent.java
index d27ad7c..0df4d6f 100644
--- a/org/gjt/sp/jedit/gui/DefaultFocusComponent.java
+++ b/org/gjt/sp/jedit/gui/DefaultFocusComponent.java
@@ -1,6 +1,6 @@
 /*
  * DefaultFocusComponent.java - Interface for dockable windows
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -29,7 +29,7 @@ package org.gjt.sp.jedit.gui;
  *
  * @since jEdit 4.2pre1
  * @author Slava Pestov
- * @version $Id: DefaultFocusComponent.java 21502 2012-03-29 17:19:44Z ezust $
+ * @version $Id: DefaultFocusComponent.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public interface DefaultFocusComponent
 {
diff --git a/org/gjt/sp/jedit/gui/DefaultInputHandler.java b/org/gjt/sp/jedit/gui/DefaultInputHandler.java
index 81006d6..561af0f 100644
--- a/org/gjt/sp/jedit/gui/DefaultInputHandler.java
+++ b/org/gjt/sp/jedit/gui/DefaultInputHandler.java
@@ -1,6 +1,6 @@
 /*
  * DefaultInputHandler.java - Default implementation of an input handler
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2003 Slava Pestov
@@ -32,7 +32,7 @@ import org.gjt.sp.jedit.*;
 /** The default input handler maps sequences of keystrokes into actions and inserts key typed events into the text area.
  *
  * @author Slava Pestov
- * @version $Id: DefaultInputHandler.java 21502 2012-03-29 17:19:44Z ezust $
+ * @version $Id: DefaultInputHandler.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class DefaultInputHandler extends InputHandler
 {
diff --git a/org/gjt/sp/jedit/gui/DockableLayout.java b/org/gjt/sp/jedit/gui/DockableLayout.java
index 78b7653..3b6888a 100644
--- a/org/gjt/sp/jedit/gui/DockableLayout.java
+++ b/org/gjt/sp/jedit/gui/DockableLayout.java
@@ -1,6 +1,6 @@
 /*
  * DockableLayout.java -- a more flexible BorderLayout
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2005 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/DockablePanel.java b/org/gjt/sp/jedit/gui/DockablePanel.java
index 06c1de6..0699786 100644
--- a/org/gjt/sp/jedit/gui/DockablePanel.java
+++ b/org/gjt/sp/jedit/gui/DockablePanel.java
@@ -1,6 +1,6 @@
 /*
  * PanelWindowContainer.java - holds dockable windows
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2004 Slava Pestov
@@ -39,7 +39,7 @@ import javax.swing.border.Border;
 
 /** A panel that holds dockable windows.
  *
- * @version $Id: DockablePanel.java 21502 2012-03-29 17:19:44Z ezust $
+ * @version $Id: DockablePanel.java 21831 2012-06-18 22:54:17Z ezust $
  */
 class DockablePanel extends JPanel
 {
diff --git a/org/gjt/sp/jedit/gui/DockableWindowFactory.java b/org/gjt/sp/jedit/gui/DockableWindowFactory.java
index 6c44f97..1142939 100644
--- a/org/gjt/sp/jedit/gui/DockableWindowFactory.java
+++ b/org/gjt/sp/jedit/gui/DockableWindowFactory.java
@@ -1,6 +1,6 @@
 /*
  * DockableWindowFactory.java - loads dockables.xml, etc
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
@@ -25,6 +25,7 @@ package org.gjt.sp.jedit.gui;
 //{{{ Imports
 import java.awt.Color;
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -90,13 +91,27 @@ public class DockableWindowFactory
 			Log.log(Log.DEBUG,DockableWindowManager.class,
 				"Loading dockables from " + uri);
 			DockableListHandler dh = new DockableListHandler(plugin,uri);
-			boolean failure = XMLUtilities.parseXML(uri.openStream(), dh);
-
-			if (!failure && cache != null)
+			InputStream in = uri.openStream();
+			if(in == null)
+			{
+				// this happened when calling generateCache() in the context of 'find orphan jars'
+				// in org.gjt.sp.jedit.pluginmgr.ManagePanel.FindOrphan.actionPerformed(ActionEvent)
+				// because for not loaded plugins, the plugin will not be added to the list of pluginJars
+				// so the org.gjt.sp.jedit.proto.jeditresource.PluginResURLConnection will not find the plugin
+				// to read the resource from.
+				// Better log a small error message than a big stack trace
+				Log.log(Log.WARNING, this, "Unable to open: " + uri);
+			}
+			else
 			{
-				cache.cachedDockableNames = dh.getCachedDockableNames();
-				cache.cachedDockableActionFlags = dh.getCachedDockableActionFlags();
-				cache.cachedDockableMovableFlags = dh.getCachedDockableMovableFlags();
+				boolean failure = XMLUtilities.parseXML(in, dh);
+	
+				if (!failure && cache != null)
+				{
+					cache.cachedDockableNames = dh.getCachedDockableNames();
+					cache.cachedDockableActionFlags = dh.getCachedDockableActionFlags();
+					cache.cachedDockableMovableFlags = dh.getCachedDockableMovableFlags();
+				}
 			}
 		}
 		catch(IOException e)
diff --git a/org/gjt/sp/jedit/gui/DockableWindowManager.java b/org/gjt/sp/jedit/gui/DockableWindowManager.java
index 24fac48..0419f20 100644
--- a/org/gjt/sp/jedit/gui/DockableWindowManager.java
+++ b/org/gjt/sp/jedit/gui/DockableWindowManager.java
@@ -113,7 +113,7 @@ import org.gjt.sp.util.Log;
  * @author Slava Pestov
  * @author John Gellene (API documentation)
  * @author Shlomy Reinstein (refactoring into a base and an impl)
- * @version $Id: DockableWindowManager.java 21504 2012-03-29 17:45:22Z ezust $
+ * @version $Id: DockableWindowManager.java 22905 2013-03-30 18:46:10Z ezust $
  * @since jEdit 2.6pre3
  *
  */
@@ -286,6 +286,7 @@ public abstract class DockableWindowManager extends JPanel
 		return getDockable(name);
 	} //}}}
 
+	
 	// {{{ toggleDockAreas()
 	/**
 	 * Hides all visible dock areas, or shows them again,
@@ -318,6 +319,15 @@ public abstract class DockableWindowManager extends JPanel
 		view.getTextArea().requestFocus();
 	} // }}}
 
+	/** @return true if the next invocation of "toggle docked areas"
+	    will hide the dockables. false otherwise.
+	*/
+	    
+	public boolean willToggleHide()
+	{
+		return closeToggle;
+	}
+
 	// {{{ dockableTitleChanged
 	public void dockableTitleChanged(String dockable, String newTitle)
 	{
diff --git a/org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java b/org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
index ea25268..f0d8672 100644
--- a/org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
+++ b/org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
@@ -1,1057 +1,1058 @@
-/*
- * DockableWindowManagerImpl.java - manages dockable windows
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2000, 2005 Slava Pestov
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.gui;
-
-//{{{ Imports
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.BufferedWriter;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Stack;
-import java.util.TreeMap;
-
-import javax.swing.AbstractButton;
-import javax.swing.JComponent;
-import javax.swing.JMenuItem;
-import javax.swing.JPanel;
-import javax.swing.JPopupMenu;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-
-import org.gjt.sp.jedit.EditBus;
-import org.gjt.sp.jedit.PluginJAR;
-import org.gjt.sp.jedit.View;
-import org.gjt.sp.jedit.jEdit;
-import org.gjt.sp.jedit.EditBus.EBHandler;
-import org.gjt.sp.jedit.View.ViewConfig;
-import org.gjt.sp.jedit.msg.DockableWindowUpdate;
-import org.gjt.sp.jedit.msg.PluginUpdate;
-import org.gjt.sp.jedit.msg.PropertiesChanged;
-import org.gjt.sp.util.Log;
-import org.gjt.sp.util.XMLUtilities;
-import org.gjt.sp.util.IOUtilities;
-import org.xml.sax.Attributes;
-import org.xml.sax.helpers.DefaultHandler;
-// }}}
-
-/** Manages dockable windows for a single View.
- *
- * Concrete implementation of a Dockable Window Manager.
- * Aka the "classic" docking framework.
- *
- * @since jEdit 4.3pre16
- * @author Slava Pestov
- * @author Shlomy Reinstein
- * @version $Id$
- */
-public class DockableWindowManagerImpl extends DockableWindowManager
-{
-
-	//{{{ DockableWindowConfig class
-	public static class DockableWindowConfig extends DockingLayout
-	{
-		// {{{ PerspectiveHandler class
-		public class PerspectiveHandler extends DefaultHandler
-		{
-			public void startElement(String uri, String localName,
-					 String qName, Attributes attrs)
-			{
-				for (int i = 0; i < attrs.getLength(); i++)
-					attribute(attrs.getQName(i), attrs.getValue(i));
-			}
-
-			private void attribute(String aname, String value)
-			{
-				if(aname.equals("TOP"))
-					top = value;
-				else if(aname.equals("LEFT"))
-					left = value;
-				else if(aname.equals("BOTTOM"))
-					bottom = value;
-				else if(aname.equals("RIGHT"))
-					right = value;
-				else if(aname.equals("TOP_POS"))
-					topPos = Integer.parseInt(value);
-				else if(aname.equals("LEFT_POS"))
-					leftPos = Integer.parseInt(value);
-				else if(aname.equals("BOTTOM_POS"))
-					bottomPos = Integer.parseInt(value);
-				else if(aname.equals("RIGHT_POS"))
-					rightPos = Integer.parseInt(value);
-			}
-		} // }}}
-
-		// dockables
-		public String top, left, bottom, right;
-		public int topPos, leftPos, bottomPos, rightPos;
-
-		public DefaultHandler getPerspectiveHandler()
-		{
-			return new PerspectiveHandler();
-		}
-
-		public boolean saveLayout(String baseName, int viewIndex)
-		{
-			String lineSep = System.getProperty("line.separator");
-			String filename = getLayoutFilename(baseName, viewIndex);
-			BufferedWriter out = null;
-			try
-			{
-				out = new BufferedWriter(new FileWriter(filename));
-				out.write("<DOCKING LEFT=\"");
-				out.write(left == null ? "" : left);
-				out.write("\" TOP=\"");
-				out.write(top == null ? "" : top);
-				out.write("\" RIGHT=\"");
-				out.write(right == null ? "" : right);
-				out.write("\" BOTTOM=\"");
-				out.write(bottom == null ? "" : bottom);
-				out.write("\" LEFT_POS=\"");
-				out.write(String.valueOf(leftPos));
-				out.write("\" TOP_POS=\"");
-				out.write(String.valueOf(topPos));
-				out.write("\" RIGHT_POS=\"");
-				out.write(String.valueOf(rightPos));
-				out.write("\" BOTTOM_POS=\"");
-				out.write(String.valueOf(bottomPos));
-				out.write("\" />");
-				out.write(lineSep);
-			}
-			catch (IOException e)
-			{
-				Log.log(Log.ERROR, this, e, e);
-				return false;
-			}
-			finally
-			{
-				IOUtilities.closeQuietly(out);
-			}
-			return true;
-		}
-
-		@Override
-		public boolean loadLayout(String baseName, int viewIndex)
-		{
-			String filename = getLayoutFilename(baseName, viewIndex);
-			DefaultHandler handler = getPerspectiveHandler();
-			try
-			{
-				// no need to close the stream it is closed by XMLUtilities.parseXML() method
-				XMLUtilities.parseXML(new FileInputStream(filename), handler);
-			}
-			catch (FileNotFoundException e)
-			{
-				return false;
-			}
-			catch (IOException e)
-			{
-				return false;
-			}
-			return true;
-		}
-
-		@Override
-		public String getName()
-		{
-			return "DockableWindowManager";
-		}
-
-	} //}}}
-
-	//{{{ Data members
-	/** A mapping from Strings to Entry objects. */
-	private Map<String, Entry> windows;
-	private PanelWindowContainer left;
-	private PanelWindowContainer right;
-	private PanelWindowContainer top;
-	private PanelWindowContainer bottom;
-	private List<Entry> clones;
-	private Entry lastEntry;
-	public Stack<String> showStack = new Stack<String>();
-	// }}}
-
-	// {{{ setDockingLayout()
-	public void setDockingLayout(DockingLayout docking)
-	{
-		DockableWindowConfig config = (DockableWindowConfig) docking;
-		if (config == null)
-			return;
-		if(config.top != null && config.top.length() != 0)
-				showDockableWindow(config.top);
-
-		if(config.left != null && config.left.length() != 0)
-				showDockableWindow(config.left);
-
-		if(config.bottom != null && config.bottom.length() != 0)
-				showDockableWindow(config.bottom);
-
-		if(config.right != null && config.right.length() != 0)
-				showDockableWindow(config.right);
-
-	} // }}}
-
-	// {{{ getDockingLayout()
-	@Override
-	public DockingLayout getDockingLayout(ViewConfig config)
-	{
-		DockableWindowConfig docking = new DockableWindowConfig();
-
-		docking.top = getTopDockingArea().getCurrent();
-		docking.left = getLeftDockingArea().getCurrent();
-		docking.bottom = getBottomDockingArea().getCurrent();
-		docking.right = getRightDockingArea().getCurrent();
-
-		docking.topPos = getTopDockingArea().getDimension();
-		docking.leftPos = getLeftDockingArea().getDimension();
-		docking.bottomPos = getBottomDockingArea().getDimension();
-		docking.rightPos = getRightDockingArea().getDimension();
-		return docking;
-	} // }}}
-
-	//{{{ DockableWindowManagerImpl constructor
-	/**
-	 * Creates a new dockable window manager.
-	 * @param view The view
-	 * @param factory A {@link DockableWindowFactory}, usually
-	 * <code>DockableWindowFactory.getInstance()</code>.
-	 * @param config A docking configuration
-	 * @since jEdit 2.6pre3
-	 */
-	public DockableWindowManagerImpl(View view, DockableWindowFactory factory,
-		View.ViewConfig config)
-	{
-		super(view, factory, config);
-		setLayout(new DockableLayout());
-
-		windows = new HashMap<String, Entry>();
-		clones = new ArrayList<Entry>();
-
-		DockableWindowConfig docking = (DockableWindowConfig) config.docking;
-		if (docking == null)
-			docking = new DockableWindowConfig();
-		top = new PanelWindowContainer(this,TOP,docking.topPos);
-		left = new PanelWindowContainer(this,LEFT,docking.leftPos);
-		bottom = new PanelWindowContainer(this,BOTTOM,docking.bottomPos);
-		right = new PanelWindowContainer(this,RIGHT,docking.rightPos);
-
-		add(DockableLayout.TOP_BUTTONS,top.buttonPanel);
-		add(DockableLayout.LEFT_BUTTONS,left.buttonPanel);
-		add(DockableLayout.BOTTOM_BUTTONS,bottom.buttonPanel);
-		add(DockableLayout.RIGHT_BUTTONS,right.buttonPanel);
-
-		add(TOP,top.dockablePanel);
-		add(LEFT,left.dockablePanel);
-		add(BOTTOM,bottom.dockablePanel);
-		add(RIGHT,right.dockablePanel);
-	} //}}}
-
-	//{{{ setMainPanel() method
-	public void setMainPanel(JPanel panel)
-	{
-		add(panel, 0);
-	} //}}}
-
-
-	//{{{ init() method
-	/**
-	 * Initialises dockable window manager. Do not call this method directly.
-	 */
-	public void init()
-	{
-		super.init();
-		Iterator<DockableWindowFactory.Window> entries = factory.getDockableWindowIterator();
-
-		while(entries.hasNext())
-			addEntry(entries.next());
-
-		propertiesChanged();
-	} //}}}
-
-	//{{{ floatDockableWindow() method
-	/**
-	 * Opens a new instance of the specified dockable window in a floating
-	 * container.
-	 * @param name The dockable window name
-	 * @return The new dockable window instance
-	 * @since jEdit 4.1pre2
-	 */
-	public JComponent floatDockableWindow(String name)
-	{
-		Entry entry = windows.get(name);
-		if(entry == null)
-		{
-			Log.log(Log.ERROR,this,"Unknown dockable window: " + name);
-			return null;
-		}
-
-		// create a copy of this dockable window and float it
-		Entry newEntry = new Entry(entry.factory,FLOATING);
-		newEntry.win = newEntry.factory.createDockableWindow(view,FLOATING);
-
-		if(newEntry.win != null)
-		{
-			FloatingWindowContainer fwc = new FloatingWindowContainer(this,true);
-			newEntry.container = fwc;
-			newEntry.container.register(newEntry);
-			newEntry.container.show(newEntry);
-
-
-		}
-		clones.add(newEntry);
-		return newEntry.win;
-	} //}}}
-
-	//{{{ showDockableWindow() method
-	/**
-	 * Opens the specified dockable window.
-	 * @param name The dockable window name
-	 * @since jEdit 2.6pre3
-	 */
-	public void showDockableWindow(String name)
-	{
-		lastEntry = windows.get(name);
-		if(lastEntry == null)
-		{
-			Log.log(Log.ERROR,this,"Unknown dockable window: " + name);
-			return;
-		}
-
-		if(lastEntry.win == null)
-		{
-			lastEntry.win = lastEntry.factory.createDockableWindow(
-				view,lastEntry.position);
-		}
-
-		if(lastEntry.win != null)
-		{
-			if(lastEntry.position.equals(FLOATING)
-				&& lastEntry.container == null)
-			{
-				FloatingWindowContainer fwc = new FloatingWindowContainer(
-					this,view.isPlainView());
-				lastEntry.container = fwc;
-				lastEntry.container.register(lastEntry);
-			}
-			showStack.push(name);
-			lastEntry.container.show(lastEntry);
-			Object reason = DockableWindowUpdate.ACTIVATED;
-			EditBus.send(new DockableWindowUpdate(this, reason, name));
-		}
-		else
-			/* an error occurred */;
-	} //}}}
-
-	//{{{ hideDockableWindow() method
-	/**
-	 * Hides the specified dockable window.
-	 * @param name The dockable window name
-	 * @since jEdit 2.6pre3
-	 */
-	public void hideDockableWindow(String name)
-	{
-		Entry entry = windows.get(name);
-		if(entry == null)
-		{
-			Log.log(Log.ERROR,this,"Unknown dockable window: " + name);
-			return;
-		}
-		if(entry.win == null)
-			return;
-		entry.container.show(null);
-	} //}}}
-
-	//{{{ getDockable() method
-	/**
-	 * Returns the specified dockable window.
-	 *
-	 * Note that this method
-	 * will return null if the dockable has not been added yet.
-	 * Make sure you call {@link #addDockableWindow(String)} first.
-	 *
-	 * For historical reasons, this
-	 * does the same thing as {@link #getDockableWindow(String)}.
-	 *
-	 * @param name The name of the dockable window
-	 * @since jEdit 4.0pre1
-	 */
-	public JComponent getDockable(String name)
-	{
-		Entry entry = windows.get(name);
-		if(entry == null || entry.win == null)
-			return null;
-		else
-			return entry.win;
-	} //}}}
-
-	//{{{ isDockableWindowVisible() method
-	/**
-	 * Returns if the specified dockable window is visible.
-	 * @param name The dockable window name
-	 */
-	public boolean isDockableWindowVisible(String name)
-	{
-		Entry entry = windows.get(name);
-		if(entry == null || entry.win == null)
-			return false;
-		else
-			return entry.container.isVisible(entry);
-	} //}}}
-
-	//{{{ isDockableWindowDocked() method
-	/**
-	 * Returns if the specified dockable window is docked into the
-	 * view.
-	 * @param name The dockable's name
-	 * @since jEdit 4.0pre2
-	 */
-	public boolean isDockableWindowDocked(String name)
-	{
-		Entry entry = windows.get(name);
-		if(entry == null)
-			return false;
-		else
-			return !entry.position.equals(FLOATING);
-	} //}}}
-
-	//{{{ closeCurrentArea() method
-	/**
-	 * Closes the most recently focused dockable.
-	 * @since jEdit 4.1pre3
-	 */
-	public void closeCurrentArea()
-	{
-		// I don't know of any other way to fix this, since invoking this
-		// command from a menu results in the focus owner being the menu
-		// until the menu goes away.
-		SwingUtilities.invokeLater(new Runnable()
-		{
-			public void run()
-			{
-				/* Try to hide the last entry that was shown */
-				try
-				{
-					String dockableName = showStack.pop();
-					hideDockableWindow(dockableName);
-					return;
-				}
-				catch (Exception e) {}
-
-				Component comp = view.getFocusOwner();
-				while(comp != null)
-				{
-					//System.err.println(comp.getClass());
-					if(comp instanceof DockablePanel)
-					{
-						DockablePanel panel = (DockablePanel) comp;
-
-						PanelWindowContainer container = panel.getWindowContainer();
-
-						container.show((DockableWindowManagerImpl.Entry) null);
-						return;
-					}
-
-					comp = comp.getParent();
-				}
-
-				getToolkit().beep();
-			}
-		});
-	} //}}}
-
-	//{{{ close() method
-	/**
-	 * Called when the view is being closed.
-	 * @since jEdit 2.6pre3
-	 */
-	public void close()
-	{
-		super.close();
-
-		for (Entry entry : windows.values())
-		{
-			if (entry.win != null)
-				entry.container.unregister(entry);
-		}
-
-		for (Entry clone : clones)
-		{
-			if (clone.win != null)
-				clone.container.unregister(clone);
-		}
-	} //}}}
-
-	//{{{ getTopDockingArea() method
-	public PanelWindowContainer getTopDockingArea()
-	{
-		return top;
-	} //}}}
-
-	//{{{ getLeftDockingArea() method
-	public PanelWindowContainer getLeftDockingArea()
-	{
-		return left;
-	} //}}}
-
-	//{{{ getBottomDockingArea() method
-	public PanelWindowContainer getBottomDockingArea()
-	{
-		return bottom;
-	} //}}}
-
-	//{{{ getRightDockingArea() method
-	public PanelWindowContainer getRightDockingArea()
-	{
-		return right;
-	} //}}}
-
-	//{{{ createPopupMenu() method
-	public JPopupMenu createPopupMenu(
-		final DockableWindowContainer container,
-		final String dockable,
-		final boolean clone)
-	{
-		JPopupMenu popup = new JPopupMenu();
-		if(dockable == null && container instanceof PanelWindowContainer)
-		{
-			ActionListener listener = new ActionListener()
-			{
-				public void actionPerformed(ActionEvent evt)
-				{
-					showDockableWindow(evt.getActionCommand());
-				}
-			};
-
-			String[] dockables = ((PanelWindowContainer)
-				container).getDockables();
-			Map<String,String> dockableMap = new TreeMap<String, String>();
-			for (int i = 0; i < dockables.length; i++)
-			{
-				String action = dockables[i];
-				dockableMap.put(getDockableTitle(action), action);
-			}
-			for (Map.Entry<String, String> entry : dockableMap.entrySet())
-			{
-				JMenuItem item = new JMenuItem(entry.getKey());
-				item.setActionCommand(entry.getValue());
-				item.addActionListener(listener);
-				popup.add(item);
-			}
-		}
-		else
-		{
-			JMenuItem caption = new JMenuItem(getDockableTitle(dockable));
-			caption.setEnabled(false);
-			popup.add(caption);
-			popup.addSeparator();
-			String currentPos = jEdit.getProperty(dockable + ".dock-position",FLOATING);
-			if(!clone)
-			{
-				String[] positions = { FLOATING, TOP, LEFT, BOTTOM, RIGHT };
-				for(int i = 0; i < positions.length; i++)
-				{
-					final String pos = positions[i];
-					if(pos.equals(currentPos))
-						continue;
-
-					JMenuItem moveMenuItem = new JMenuItem(jEdit.getProperty("view.docking.menu-"
-						+ pos));
-
-					moveMenuItem.addActionListener(new ActionListener()
-					{
-						public void actionPerformed(ActionEvent evt)
-						{
-							jEdit.setProperty(dockable + ".dock-position",pos);
-							EditBus.send(new DockableWindowUpdate(
-								DockableWindowManagerImpl.this,
-								DockableWindowUpdate.PROPERTIES_CHANGED,
-								dockable
-							));
-							showDockableWindow(dockable);
-						}
-					});
-					popup.add(moveMenuItem);
-				}
-
-				popup.addSeparator();
-			}
-
-			JMenuItem cloneMenuItem = new JMenuItem(jEdit.getProperty("view.docking.menu-clone"));
-
-			cloneMenuItem.addActionListener(new ActionListener()
-			{
-				public void actionPerformed(ActionEvent evt)
-				{
-					floatDockableWindow(dockable);
-				}
-			});
-			popup.add(cloneMenuItem);
-
-			popup.addSeparator();
-
-			JMenuItem closeMenuItem = new JMenuItem(jEdit.getProperty("view.docking.menu-close"));
-
-			closeMenuItem.addActionListener(new ActionListener()
-			{
-				public void actionPerformed(ActionEvent evt)
-				{
-					if(clone)
-						((FloatingWindowContainer)container).dispose();
-					else
-						removeDockableWindow(dockable);
-				}
-			});
-			popup.add(closeMenuItem);
-
-			if(!(clone || currentPos.equals(FLOATING)))
-			{
-				JMenuItem undockMenuItem = new JMenuItem(jEdit.getProperty("view.docking.menu-undock"));
-
-				undockMenuItem.addActionListener(new ActionListener()
-				{
-					public void actionPerformed(ActionEvent evt)
-					{
-						jEdit.setProperty(dockable + ".dock-position",FLOATING);
-						EditBus.send(new DockableWindowUpdate(
-							DockableWindowManagerImpl.this,
-							DockableWindowUpdate.PROPERTIES_CHANGED,
-							dockable
-						));
-						// Reset the window, propertiesChanged() doesn't
-						// reset it for MOVABLE windows.
-						Entry entry = windows.get(dockable);
-						if (entry == null)
-							Log.log(Log.ERROR,this,"Unknown dockable window: " + dockable);
-						else
-							entry.win = null;
-					}
-				});
-				popup.add(undockMenuItem);
-			}
-		}
-
-		return popup;
-	} //}}}
-
-	//{{{ paintChildren() method
-	public void paintChildren(Graphics g)
-	{
-		super.paintChildren(g);
-
-		if(resizeRect != null)
-		{
-			g.setColor(Color.darkGray);
-			g.fillRect(resizeRect.x,resizeRect.y,
-				resizeRect.width,resizeRect.height);
-		}
-	} //}}}
-
-	//{{{ handleDockableWindowUpdate() method
-	@EBHandler
-	public void handleDockableWindowUpdate(DockableWindowUpdate msg)
-	{
-		if (msg.getWhat() == DockableWindowUpdate.PROPERTIES_CHANGED)
-			propertiesChanged();
-	} //}}}
-
-	//{{{ handlePropertiesChanged() method
-	@EBHandler
-	public void handlePropertiesChanged(PropertiesChanged msg)
-	{
-		propertiesChanged();
-	} //}}}
-
-	//{{{ handlePluginUpdate() method
-	@EBHandler
-	public void handlePluginUpdate(PluginUpdate pmsg)
-	{
-		if(pmsg.getWhat() == PluginUpdate.LOADED)
-		{
-			Iterator<DockableWindowFactory.Window> iter = factory.getDockableWindowIterator();
-
-			while(iter.hasNext())
-			{
-				DockableWindowFactory.Window w = iter.next();
-				if(w.plugin == pmsg.getPluginJAR())
-					addEntry(w);
-			}
-
-			propertiesChanged();
-		}
-		else if(pmsg.isExiting())
-		{
-			// we don't care
-		}
-		else if(pmsg.getWhat() == PluginUpdate.DEACTIVATED)
-		{
-			Iterator<Entry> iter = getAllPluginEntries(
-				pmsg.getPluginJAR(),false);
-			while(iter.hasNext())
-			{
-				Entry entry = iter.next();
-				if(entry.container != null)
-					entry.container.remove(entry);
-			}
-		}
-		else if(pmsg.getWhat() == PluginUpdate.UNLOADED)
-		{
-			Iterator<Entry> iter = getAllPluginEntries(
-				pmsg.getPluginJAR(),true);
-			while(iter.hasNext())
-			{
-				Entry entry = iter.next();
-				if(entry.container != null)
-				{
-					entry.container.unregister(entry);
-					entry.win = null;
-					entry.container = null;
-				}
-			}
-		}
-	} //}}}
-
-	//{{{ Package-private members
-	int resizePos;
-	/**
-	 * This is the rectangle you drag to resize the split.
-	 * It is used with non continuous layout.
-	 */
-	Rectangle resizeRect;
-
-	//{{{ setResizePos() method
-	void setResizePos(int resizePos, PanelWindowContainer resizing)
-	{
-		this.resizePos = resizePos;
-
-		if(resizePos < 0)
-			resizePos = 0;
-
-		if (continuousLayout)
-			return;
-
-		Rectangle newResizeRect = new Rectangle(0,0,
-			PanelWindowContainer.SPLITTER_WIDTH - 2,
-			PanelWindowContainer.SPLITTER_WIDTH - 2);
-		if(resizing == top)
-		{
-			resizePos = Math.min(resizePos,getHeight()
-				- top.buttonPanel.getHeight()
-				- bottom.dockablePanel.getHeight()
-				- bottom.buttonPanel.getHeight()
-				- PanelWindowContainer.SPLITTER_WIDTH);
-			newResizeRect.x = top.dockablePanel.getX() + 1;
-			newResizeRect.y = resizePos + top.buttonPanel.getHeight() + 1;
-			newResizeRect.width = top.dockablePanel.getWidth() - 2;
-		}
-		else if(resizing == left)
-		{
-			resizePos = Math.min(resizePos,getWidth()
-				- left.buttonPanel.getWidth()
-				- right.dockablePanel.getWidth()
-				- right.buttonPanel.getWidth()
-				- PanelWindowContainer.SPLITTER_WIDTH);
-			newResizeRect.x = resizePos + left.buttonPanel.getWidth() + 1;
-			newResizeRect.y = left.dockablePanel.getY() + 1;
-			newResizeRect.height = left.dockablePanel.getHeight() - 2;
-		}
-		else if(resizing == bottom)
-		{
-			resizePos = Math.min(resizePos,getHeight()
-				- bottom.buttonPanel.getHeight()
-				- top.dockablePanel.getHeight()
-				- top.buttonPanel.getHeight()
-				- PanelWindowContainer.SPLITTER_WIDTH);
-			newResizeRect.x = bottom.dockablePanel.getX() + 1;
-			newResizeRect.y = getHeight() - bottom.buttonPanel.getHeight() - resizePos
-				- PanelWindowContainer.SPLITTER_WIDTH + 2;
-			newResizeRect.width = bottom.dockablePanel.getWidth() - 2;
-		}
-		else if(resizing == right)
-		{
-			resizePos = Math.min(resizePos,getWidth()
-				- right.buttonPanel.getWidth()
-				- left.dockablePanel.getWidth()
-				- left.buttonPanel.getWidth()
-				- PanelWindowContainer.SPLITTER_WIDTH);
-			newResizeRect.x = getWidth() - right.buttonPanel.getWidth() - resizePos
-				- PanelWindowContainer.SPLITTER_WIDTH + 1;
-			newResizeRect.y = right.dockablePanel.getY() + 1;
-			newResizeRect.height = right.dockablePanel.getHeight() - 2;
-		}
-
-		Rectangle toRepaint;
-		if(resizeRect == null)
-			toRepaint = newResizeRect;
-		else
-			toRepaint = resizeRect.union(newResizeRect);
-		resizeRect = newResizeRect;
-		repaint(toRepaint);
-	} //}}}
-
-	//{{{ finishResizing() method
-	void finishResizing()
-	{
-		resizeRect = null;
-		repaint();
-	} //}}}
-
-	//}}}
-
-	//{{{ propertiesChanged() method
-	protected void propertiesChanged()
-	{
-		if(view.isPlainView())
-			return;
-
-		((DockableLayout)getLayout()).setAlternateLayout(
-			jEdit.getBooleanProperty("view.docking.alternateLayout"));
-
-		String[] windowList = factory.getRegisteredDockableWindows();
-
-		for(int i = 0; i < windowList.length; i++)
-		{
-			String dockable = windowList[i];
-			Entry entry = windows.get(dockable);
-			if (entry == null)
-			{
-				// this can happens during a plugin loading when a dockable has been registered but the window
-				// is not yet created if the plugin has some jars.
-				continue;
-			}
-			String newPosition = jEdit.getProperty(dockable
-				+ ".dock-position",FLOATING);
-			if(newPosition.equals(entry.position))
-			{
-				continue;
-			}
-
-			entry.position = newPosition;
-			if(entry.container != null)
-			{
-				entry.container.unregister(entry);
-				entry.container = null;
-				if (entry.factory.movable && (! newPosition.equals(FLOATING)))
-				{
-					if (entry.win instanceof DockableWindow)
-						((DockableWindow)entry.win).move(newPosition);
-				}
-				else
-					entry.win = null;
-			}
-
-			if(newPosition.equals(FLOATING))
-			{
-			}
-
-			else
-			{
-				if(newPosition.equals(TOP))
-					entry.container = top;
-				else if(newPosition.equals(LEFT))
-					entry.container = left;
-				else if(newPosition.equals(BOTTOM))
-					entry.container = bottom;
-				else if(newPosition.equals(RIGHT))
-					entry.container = right;
-				else
-				{
-					Log.log(Log.WARNING,this,
-						"Unknown position: "
-						+ newPosition);
-					continue;
-				}
-
-				entry.container.register(entry);
-			}
-		}
-
-		top.sortDockables();
-		left.sortDockables();
-		bottom.sortDockables();
-		right.sortDockables();
-
-		continuousLayout = UIManager.getBoolean("SplitPane.continuousLayout");
-		revalidate();
-		repaint();
-	} //}}}
-
-	//{{{ addEntry() method
-	private void addEntry(DockableWindowFactory.Window factory)
-	{
-		Entry e;
-		if(view.isPlainView())
-		{
-			// don't show menu items to dock into a plain view
-			e = new Entry(factory,FLOATING);
-		}
-		else
-		{
-			e = new Entry(factory);
-			if(e.position.equals(FLOATING))
-				/* nothing to do */;
-			else if(e.position.equals(TOP))
-				e.container = top;
-			else if(e.position.equals(LEFT))
-				e.container = left;
-			else if(e.position.equals(BOTTOM))
-				e.container = bottom;
-			else if(e.position.equals(RIGHT))
-				e.container = right;
-			else
-			{
-				Log.log(Log.WARNING,this,
-					"Unknown position: "
-					+ e.position);
-			}
-
-			if(e.container != null)
-				e.container.register(e);
-		}
-		windows.put(factory.name,e);
-	} //}}}
-
-	//{{{ getAllPluginEntries() method
-	/**
-	 * If remove is false, only remove from clones list, otherwise remove
-	 * from both entries and clones.
-	 */
-	private Iterator<Entry> getAllPluginEntries(PluginJAR plugin, boolean remove)
-	{
-		List<Entry> returnValue = new LinkedList<Entry>();
-		Iterator<Entry> iter = windows.values().iterator();
-		while(iter.hasNext())
-		{
-			Entry entry = iter.next();
-			if(entry.factory.plugin == plugin)
-			{
-				returnValue.add(entry);
-				if(remove)
-					iter.remove();
-			}
-		}
-
-		iter = clones.iterator();
-		while(iter.hasNext())
-		{
-			Entry entry = iter.next();
-			if(entry.factory.plugin == plugin)
-			{
-				returnValue.add(entry);
-				iter.remove();
-			}
-		}
-
-		return returnValue.iterator();
-	} //}}}
-
-	private boolean continuousLayout;
-
-	//{{{ Entry class
-	static class Entry
-	{
-		DockableWindowFactory.Window factory;
-
-//		String title;
-		String position;
-		DockableWindowContainer container;
-
-		// only set if open
-		JComponent win;
-
-		// only for docked
-		AbstractButton btn;
-
-		//{{{ Entry constructor
-		Entry(DockableWindowFactory.Window factory)
-		{
-			this(factory,jEdit.getProperty(factory.name
-				+ ".dock-position",FLOATING));
-		} //}}}
-
-
-		/**
-		 * @return the long title for the dockable floating window.
-		 */
-		public String longTitle()
-		{
-			String title = jEdit.getProperty(factory.name + ".longtitle");
-			if (title == null) return shortTitle();
-			else return title;
-
-		}
-
-		/**
-		 * @return The short title, for the dockable button text
-		 */
-		public String shortTitle()
-		{
-
-			String title = jEdit.getProperty(factory.name + ".title");
-			if(title == null)
-				return "NO TITLE PROPERTY: " + factory.name;
-			else
-				return title;
-		}
-
-		/**
-		 * @return A label appropriate for the title on the dock buttons.
-		 */
-		public String label()
-		{
-			String retval = jEdit.getProperty(factory.name + ".label");
-			retval = retval.replaceAll("\\$", "");
-			return retval;
-		}
-
-		//{{{ Entry constructor
-		Entry(DockableWindowFactory.Window factory, String position)
-		{
-			this.factory = factory;
-			this.position = position;
-
-			// get the title here, not in the factory constructor,
-			// since the factory might be created before a plugin's
-			// props are loaded
-
-		} //}}}
-	} //}}}
-
-	@Override
-	public void disposeDockableWindow(String name)
-	{
-		// Nothing to do here; called as a response to plugin unloading,
-		// handled differently by this implementation.
-	}
-}
+/*
+ * DockableWindowManagerImpl.java - manages dockable windows
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2000, 2005 Slava Pestov
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.gui;
+
+//{{{ Imports
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.BufferedWriter;
+import java.io.Closeable;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
+import java.util.TreeMap;
+
+import javax.swing.AbstractButton;
+import javax.swing.JComponent;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+
+import org.gjt.sp.jedit.EditBus;
+import org.gjt.sp.jedit.PluginJAR;
+import org.gjt.sp.jedit.View;
+import org.gjt.sp.jedit.jEdit;
+import org.gjt.sp.jedit.EditBus.EBHandler;
+import org.gjt.sp.jedit.View.ViewConfig;
+import org.gjt.sp.jedit.msg.DockableWindowUpdate;
+import org.gjt.sp.jedit.msg.PluginUpdate;
+import org.gjt.sp.jedit.msg.PropertiesChanged;
+import org.gjt.sp.util.Log;
+import org.gjt.sp.util.XMLUtilities;
+import org.gjt.sp.util.IOUtilities;
+import org.xml.sax.Attributes;
+import org.xml.sax.helpers.DefaultHandler;
+// }}}
+
+/** Manages dockable windows for a single View.
+ *
+ * Concrete implementation of a Dockable Window Manager.
+ * Aka the "classic" docking framework.
+ *
+ * @since jEdit 4.3pre16
+ * @author Slava Pestov
+ * @author Shlomy Reinstein
+ * @version $Id$
+ */
+public class DockableWindowManagerImpl extends DockableWindowManager
+{
+
+	//{{{ DockableWindowConfig class
+	public static class DockableWindowConfig extends DockingLayout
+	{
+		// {{{ PerspectiveHandler class
+		public class PerspectiveHandler extends DefaultHandler
+		{
+			public void startElement(String uri, String localName,
+					 String qName, Attributes attrs)
+			{
+				for (int i = 0; i < attrs.getLength(); i++)
+					attribute(attrs.getQName(i), attrs.getValue(i));
+			}
+
+			private void attribute(String aname, String value)
+			{
+				if(aname.equals("TOP"))
+					top = value;
+				else if(aname.equals("LEFT"))
+					left = value;
+				else if(aname.equals("BOTTOM"))
+					bottom = value;
+				else if(aname.equals("RIGHT"))
+					right = value;
+				else if(aname.equals("TOP_POS"))
+					topPos = Integer.parseInt(value);
+				else if(aname.equals("LEFT_POS"))
+					leftPos = Integer.parseInt(value);
+				else if(aname.equals("BOTTOM_POS"))
+					bottomPos = Integer.parseInt(value);
+				else if(aname.equals("RIGHT_POS"))
+					rightPos = Integer.parseInt(value);
+			}
+		} // }}}
+
+		// dockables
+		public String top, left, bottom, right;
+		public int topPos, leftPos, bottomPos, rightPos;
+
+		public DefaultHandler getPerspectiveHandler()
+		{
+			return new PerspectiveHandler();
+		}
+
+		public boolean saveLayout(String baseName, int viewIndex)
+		{
+			String lineSep = System.getProperty("line.separator");
+			String filename = getLayoutFilename(baseName, viewIndex);
+			BufferedWriter out = null;
+			try
+			{
+				out = new BufferedWriter(new FileWriter(filename));
+				out.write("<DOCKING LEFT=\"");
+				out.write(left == null ? "" : left);
+				out.write("\" TOP=\"");
+				out.write(top == null ? "" : top);
+				out.write("\" RIGHT=\"");
+				out.write(right == null ? "" : right);
+				out.write("\" BOTTOM=\"");
+				out.write(bottom == null ? "" : bottom);
+				out.write("\" LEFT_POS=\"");
+				out.write(String.valueOf(leftPos));
+				out.write("\" TOP_POS=\"");
+				out.write(String.valueOf(topPos));
+				out.write("\" RIGHT_POS=\"");
+				out.write(String.valueOf(rightPos));
+				out.write("\" BOTTOM_POS=\"");
+				out.write(String.valueOf(bottomPos));
+				out.write("\" />");
+				out.write(lineSep);
+			}
+			catch (IOException e)
+			{
+				Log.log(Log.ERROR, this, e, e);
+				return false;
+			}
+			finally
+			{
+				IOUtilities.closeQuietly((Closeable)out);
+			}
+			return true;
+		}
+
+		@Override
+		public boolean loadLayout(String baseName, int viewIndex)
+		{
+			String filename = getLayoutFilename(baseName, viewIndex);
+			DefaultHandler handler = getPerspectiveHandler();
+			try
+			{
+				// no need to close the stream it is closed by XMLUtilities.parseXML() method
+				XMLUtilities.parseXML(new FileInputStream(filename), handler);
+			}
+			catch (FileNotFoundException e)
+			{
+				return false;
+			}
+			catch (IOException e)
+			{
+				return false;
+			}
+			return true;
+		}
+
+		@Override
+		public String getName()
+		{
+			return "DockableWindowManager";
+		}
+
+	} //}}}
+
+	//{{{ Data members
+	/** A mapping from Strings to Entry objects. */
+	private Map<String, Entry> windows;
+	private PanelWindowContainer left;
+	private PanelWindowContainer right;
+	private PanelWindowContainer top;
+	private PanelWindowContainer bottom;
+	private List<Entry> clones;
+	private Entry lastEntry;
+	public Stack<String> showStack = new Stack<String>();
+	// }}}
+
+	// {{{ setDockingLayout()
+	public void setDockingLayout(DockingLayout docking)
+	{
+		DockableWindowConfig config = (DockableWindowConfig) docking;
+		if (config == null)
+			return;
+		if(config.top != null && config.top.length() != 0)
+				showDockableWindow(config.top);
+
+		if(config.left != null && config.left.length() != 0)
+				showDockableWindow(config.left);
+
+		if(config.bottom != null && config.bottom.length() != 0)
+				showDockableWindow(config.bottom);
+
+		if(config.right != null && config.right.length() != 0)
+				showDockableWindow(config.right);
+
+	} // }}}
+
+	// {{{ getDockingLayout()
+	@Override
+	public DockingLayout getDockingLayout(ViewConfig config)
+	{
+		DockableWindowConfig docking = new DockableWindowConfig();
+
+		docking.top = getTopDockingArea().getCurrent();
+		docking.left = getLeftDockingArea().getCurrent();
+		docking.bottom = getBottomDockingArea().getCurrent();
+		docking.right = getRightDockingArea().getCurrent();
+
+		docking.topPos = getTopDockingArea().getDimension();
+		docking.leftPos = getLeftDockingArea().getDimension();
+		docking.bottomPos = getBottomDockingArea().getDimension();
+		docking.rightPos = getRightDockingArea().getDimension();
+		return docking;
+	} // }}}
+
+	//{{{ DockableWindowManagerImpl constructor
+	/**
+	 * Creates a new dockable window manager.
+	 * @param view The view
+	 * @param factory A {@link DockableWindowFactory}, usually
+	 * <code>DockableWindowFactory.getInstance()</code>.
+	 * @param config A docking configuration
+	 * @since jEdit 2.6pre3
+	 */
+	public DockableWindowManagerImpl(View view, DockableWindowFactory factory,
+		View.ViewConfig config)
+	{
+		super(view, factory, config);
+		setLayout(new DockableLayout());
+
+		windows = new HashMap<String, Entry>();
+		clones = new ArrayList<Entry>();
+
+		DockableWindowConfig docking = (DockableWindowConfig) config.docking;
+		if (docking == null)
+			docking = new DockableWindowConfig();
+		top = new PanelWindowContainer(this,TOP,docking.topPos);
+		left = new PanelWindowContainer(this,LEFT,docking.leftPos);
+		bottom = new PanelWindowContainer(this,BOTTOM,docking.bottomPos);
+		right = new PanelWindowContainer(this,RIGHT,docking.rightPos);
+
+		add(DockableLayout.TOP_BUTTONS,top.buttonPanel);
+		add(DockableLayout.LEFT_BUTTONS,left.buttonPanel);
+		add(DockableLayout.BOTTOM_BUTTONS,bottom.buttonPanel);
+		add(DockableLayout.RIGHT_BUTTONS,right.buttonPanel);
+
+		add(TOP,top.dockablePanel);
+		add(LEFT,left.dockablePanel);
+		add(BOTTOM,bottom.dockablePanel);
+		add(RIGHT,right.dockablePanel);
+	} //}}}
+
+	//{{{ setMainPanel() method
+	public void setMainPanel(JPanel panel)
+	{
+		add(panel, 0);
+	} //}}}
+
+
+	//{{{ init() method
+	/**
+	 * Initialises dockable window manager. Do not call this method directly.
+	 */
+	public void init()
+	{
+		super.init();
+		Iterator<DockableWindowFactory.Window> entries = factory.getDockableWindowIterator();
+
+		while(entries.hasNext())
+			addEntry(entries.next());
+
+		propertiesChanged();
+	} //}}}
+
+	//{{{ floatDockableWindow() method
+	/**
+	 * Opens a new instance of the specified dockable window in a floating
+	 * container.
+	 * @param name The dockable window name
+	 * @return The new dockable window instance
+	 * @since jEdit 4.1pre2
+	 */
+	public JComponent floatDockableWindow(String name)
+	{
+		Entry entry = windows.get(name);
+		if(entry == null)
+		{
+			Log.log(Log.ERROR,this,"Unknown dockable window: " + name);
+			return null;
+		}
+
+		// create a copy of this dockable window and float it
+		Entry newEntry = new Entry(entry.factory,FLOATING);
+		newEntry.win = newEntry.factory.createDockableWindow(view,FLOATING);
+
+		if(newEntry.win != null)
+		{
+			FloatingWindowContainer fwc = new FloatingWindowContainer(this,true);
+			newEntry.container = fwc;
+			newEntry.container.register(newEntry);
+			newEntry.container.show(newEntry);
+
+
+		}
+		clones.add(newEntry);
+		return newEntry.win;
+	} //}}}
+
+	//{{{ showDockableWindow() method
+	/**
+	 * Opens the specified dockable window.
+	 * @param name The dockable window name
+	 * @since jEdit 2.6pre3
+	 */
+	public void showDockableWindow(String name)
+	{
+		lastEntry = windows.get(name);
+		if(lastEntry == null)
+		{
+			Log.log(Log.ERROR,this,"Unknown dockable window: " + name);
+			return;
+		}
+
+		if(lastEntry.win == null)
+		{
+			lastEntry.win = lastEntry.factory.createDockableWindow(
+				view,lastEntry.position);
+		}
+
+		if(lastEntry.win != null)
+		{
+			if(lastEntry.position.equals(FLOATING)
+				&& lastEntry.container == null)
+			{
+				FloatingWindowContainer fwc = new FloatingWindowContainer(
+					this,view.isPlainView());
+				lastEntry.container = fwc;
+				lastEntry.container.register(lastEntry);
+			}
+			showStack.push(name);
+			lastEntry.container.show(lastEntry);
+			Object reason = DockableWindowUpdate.ACTIVATED;
+			EditBus.send(new DockableWindowUpdate(this, reason, name));
+		}
+		else
+			/* an error occurred */;
+	} //}}}
+
+	//{{{ hideDockableWindow() method
+	/**
+	 * Hides the specified dockable window.
+	 * @param name The dockable window name
+	 * @since jEdit 2.6pre3
+	 */
+	public void hideDockableWindow(String name)
+	{
+		Entry entry = windows.get(name);
+		if(entry == null)
+		{
+			Log.log(Log.ERROR,this,"Unknown dockable window: " + name);
+			return;
+		}
+		if(entry.win == null)
+			return;
+		entry.container.show(null);
+	} //}}}
+
+	//{{{ getDockable() method
+	/**
+	 * Returns the specified dockable window.
+	 *
+	 * Note that this method
+	 * will return null if the dockable has not been added yet.
+	 * Make sure you call {@link #addDockableWindow(String)} first.
+	 *
+	 * For historical reasons, this
+	 * does the same thing as {@link #getDockableWindow(String)}.
+	 *
+	 * @param name The name of the dockable window
+	 * @since jEdit 4.0pre1
+	 */
+	public JComponent getDockable(String name)
+	{
+		Entry entry = windows.get(name);
+		if(entry == null || entry.win == null)
+			return null;
+		else
+			return entry.win;
+	} //}}}
+
+	//{{{ isDockableWindowVisible() method
+	/**
+	 * Returns if the specified dockable window is visible.
+	 * @param name The dockable window name
+	 */
+	public boolean isDockableWindowVisible(String name)
+	{
+		Entry entry = windows.get(name);
+		if(entry == null || entry.win == null)
+			return false;
+		else
+			return entry.container.isVisible(entry);
+	} //}}}
+
+	//{{{ isDockableWindowDocked() method
+	/**
+	 * Returns if the specified dockable window is docked into the
+	 * view.
+	 * @param name The dockable's name
+	 * @since jEdit 4.0pre2
+	 */
+	public boolean isDockableWindowDocked(String name)
+	{
+		Entry entry = windows.get(name);
+		if(entry == null)
+			return false;
+		else
+			return !entry.position.equals(FLOATING);
+	} //}}}
+
+	//{{{ closeCurrentArea() method
+	/**
+	 * Closes the most recently focused dockable.
+	 * @since jEdit 4.1pre3
+	 */
+	public void closeCurrentArea()
+	{
+		// I don't know of any other way to fix this, since invoking this
+		// command from a menu results in the focus owner being the menu
+		// until the menu goes away.
+		SwingUtilities.invokeLater(new Runnable()
+		{
+			public void run()
+			{
+				/* Try to hide the last entry that was shown */
+				try
+				{
+					String dockableName = showStack.pop();
+					hideDockableWindow(dockableName);
+					return;
+				}
+				catch (Exception e) {}
+
+				Component comp = view.getFocusOwner();
+				while(comp != null)
+				{
+					//System.err.println(comp.getClass());
+					if(comp instanceof DockablePanel)
+					{
+						DockablePanel panel = (DockablePanel) comp;
+
+						PanelWindowContainer container = panel.getWindowContainer();
+
+						container.show((DockableWindowManagerImpl.Entry) null);
+						return;
+					}
+
+					comp = comp.getParent();
+				}
+
+				getToolkit().beep();
+			}
+		});
+	} //}}}
+
+	//{{{ close() method
+	/**
+	 * Called when the view is being closed.
+	 * @since jEdit 2.6pre3
+	 */
+	public void close()
+	{
+		super.close();
+
+		for (Entry entry : windows.values())
+		{
+			if (entry.win != null)
+				entry.container.unregister(entry);
+		}
+
+		for (Entry clone : clones)
+		{
+			if (clone.win != null)
+				clone.container.unregister(clone);
+		}
+	} //}}}
+
+	//{{{ getTopDockingArea() method
+	public PanelWindowContainer getTopDockingArea()
+	{
+		return top;
+	} //}}}
+
+	//{{{ getLeftDockingArea() method
+	public PanelWindowContainer getLeftDockingArea()
+	{
+		return left;
+	} //}}}
+
+	//{{{ getBottomDockingArea() method
+	public PanelWindowContainer getBottomDockingArea()
+	{
+		return bottom;
+	} //}}}
+
+	//{{{ getRightDockingArea() method
+	public PanelWindowContainer getRightDockingArea()
+	{
+		return right;
+	} //}}}
+
+	//{{{ createPopupMenu() method
+	public JPopupMenu createPopupMenu(
+		final DockableWindowContainer container,
+		final String dockable,
+		final boolean clone)
+	{
+		JPopupMenu popup = new JPopupMenu();
+		if(dockable == null && container instanceof PanelWindowContainer)
+		{
+			ActionListener listener = new ActionListener()
+			{
+				public void actionPerformed(ActionEvent evt)
+				{
+					showDockableWindow(evt.getActionCommand());
+				}
+			};
+
+			String[] dockables = ((PanelWindowContainer)
+				container).getDockables();
+			Map<String,String> dockableMap = new TreeMap<String, String>();
+			for (int i = 0; i < dockables.length; i++)
+			{
+				String action = dockables[i];
+				dockableMap.put(getDockableTitle(action), action);
+			}
+			for (Map.Entry<String, String> entry : dockableMap.entrySet())
+			{
+				JMenuItem item = new JMenuItem(entry.getKey());
+				item.setActionCommand(entry.getValue());
+				item.addActionListener(listener);
+				popup.add(item);
+			}
+		}
+		else
+		{
+			JMenuItem caption = new JMenuItem(getDockableTitle(dockable));
+			caption.setEnabled(false);
+			popup.add(caption);
+			popup.addSeparator();
+			String currentPos = jEdit.getProperty(dockable + ".dock-position",FLOATING);
+			if(!clone)
+			{
+				String[] positions = { FLOATING, TOP, LEFT, BOTTOM, RIGHT };
+				for(int i = 0; i < positions.length; i++)
+				{
+					final String pos = positions[i];
+					if(pos.equals(currentPos))
+						continue;
+
+					JMenuItem moveMenuItem = new JMenuItem(jEdit.getProperty("view.docking.menu-"
+						+ pos));
+
+					moveMenuItem.addActionListener(new ActionListener()
+					{
+						public void actionPerformed(ActionEvent evt)
+						{
+							jEdit.setProperty(dockable + ".dock-position",pos);
+							EditBus.send(new DockableWindowUpdate(
+								DockableWindowManagerImpl.this,
+								DockableWindowUpdate.PROPERTIES_CHANGED,
+								dockable
+							));
+							showDockableWindow(dockable);
+						}
+					});
+					popup.add(moveMenuItem);
+				}
+
+				popup.addSeparator();
+			}
+
+			JMenuItem cloneMenuItem = new JMenuItem(jEdit.getProperty("view.docking.menu-clone"));
+
+			cloneMenuItem.addActionListener(new ActionListener()
+			{
+				public void actionPerformed(ActionEvent evt)
+				{
+					floatDockableWindow(dockable);
+				}
+			});
+			popup.add(cloneMenuItem);
+
+			popup.addSeparator();
+
+			JMenuItem closeMenuItem = new JMenuItem(jEdit.getProperty("view.docking.menu-close"));
+
+			closeMenuItem.addActionListener(new ActionListener()
+			{
+				public void actionPerformed(ActionEvent evt)
+				{
+					if(clone)
+						((FloatingWindowContainer)container).dispose();
+					else
+						removeDockableWindow(dockable);
+				}
+			});
+			popup.add(closeMenuItem);
+
+			if(!(clone || currentPos.equals(FLOATING)))
+			{
+				JMenuItem undockMenuItem = new JMenuItem(jEdit.getProperty("view.docking.menu-undock"));
+
+				undockMenuItem.addActionListener(new ActionListener()
+				{
+					public void actionPerformed(ActionEvent evt)
+					{
+						jEdit.setProperty(dockable + ".dock-position",FLOATING);
+						EditBus.send(new DockableWindowUpdate(
+							DockableWindowManagerImpl.this,
+							DockableWindowUpdate.PROPERTIES_CHANGED,
+							dockable
+						));
+						// Reset the window, propertiesChanged() doesn't
+						// reset it for MOVABLE windows.
+						Entry entry = windows.get(dockable);
+						if (entry == null)
+							Log.log(Log.ERROR,this,"Unknown dockable window: " + dockable);
+						else
+							entry.win = null;
+					}
+				});
+				popup.add(undockMenuItem);
+			}
+		}
+
+		return popup;
+	} //}}}
+
+	//{{{ paintChildren() method
+	public void paintChildren(Graphics g)
+	{
+		super.paintChildren(g);
+
+		if(resizeRect != null)
+		{
+			g.setColor(Color.darkGray);
+			g.fillRect(resizeRect.x,resizeRect.y,
+				resizeRect.width,resizeRect.height);
+		}
+	} //}}}
+
+	//{{{ handleDockableWindowUpdate() method
+	@EBHandler
+	public void handleDockableWindowUpdate(DockableWindowUpdate msg)
+	{
+		if (msg.getWhat() == DockableWindowUpdate.PROPERTIES_CHANGED)
+			propertiesChanged();
+	} //}}}
+
+	//{{{ handlePropertiesChanged() method
+	@EBHandler
+	public void handlePropertiesChanged(PropertiesChanged msg)
+	{
+		propertiesChanged();
+	} //}}}
+
+	//{{{ handlePluginUpdate() method
+	@EBHandler
+	public void handlePluginUpdate(PluginUpdate pmsg)
+	{
+		if(pmsg.getWhat() == PluginUpdate.LOADED)
+		{
+			Iterator<DockableWindowFactory.Window> iter = factory.getDockableWindowIterator();
+
+			while(iter.hasNext())
+			{
+				DockableWindowFactory.Window w = iter.next();
+				if(w.plugin == pmsg.getPluginJAR())
+					addEntry(w);
+			}
+
+			propertiesChanged();
+		}
+		else if(pmsg.isExiting())
+		{
+			// we don't care
+		}
+		else if(pmsg.getWhat() == PluginUpdate.DEACTIVATED)
+		{
+			Iterator<Entry> iter = getAllPluginEntries(
+				pmsg.getPluginJAR(),false);
+			while(iter.hasNext())
+			{
+				Entry entry = iter.next();
+				if(entry.container != null)
+					entry.container.remove(entry);
+			}
+		}
+		else if(pmsg.getWhat() == PluginUpdate.UNLOADED)
+		{
+			Iterator<Entry> iter = getAllPluginEntries(
+				pmsg.getPluginJAR(),true);
+			while(iter.hasNext())
+			{
+				Entry entry = iter.next();
+				if(entry.container != null)
+				{
+					entry.container.unregister(entry);
+					entry.win = null;
+					entry.container = null;
+				}
+			}
+		}
+	} //}}}
+
+	//{{{ Package-private members
+	int resizePos;
+	/**
+	 * This is the rectangle you drag to resize the split.
+	 * It is used with non continuous layout.
+	 */
+	Rectangle resizeRect;
+
+	//{{{ setResizePos() method
+	void setResizePos(int resizePos, PanelWindowContainer resizing)
+	{
+		this.resizePos = resizePos;
+
+		if(resizePos < 0)
+			resizePos = 0;
+
+		if (continuousLayout)
+			return;
+
+		Rectangle newResizeRect = new Rectangle(0,0,
+			PanelWindowContainer.SPLITTER_WIDTH - 2,
+			PanelWindowContainer.SPLITTER_WIDTH - 2);
+		if(resizing == top)
+		{
+			resizePos = Math.min(resizePos,getHeight()
+				- top.buttonPanel.getHeight()
+				- bottom.dockablePanel.getHeight()
+				- bottom.buttonPanel.getHeight()
+				- PanelWindowContainer.SPLITTER_WIDTH);
+			newResizeRect.x = top.dockablePanel.getX() + 1;
+			newResizeRect.y = resizePos + top.buttonPanel.getHeight() + 1;
+			newResizeRect.width = top.dockablePanel.getWidth() - 2;
+		}
+		else if(resizing == left)
+		{
+			resizePos = Math.min(resizePos,getWidth()
+				- left.buttonPanel.getWidth()
+				- right.dockablePanel.getWidth()
+				- right.buttonPanel.getWidth()
+				- PanelWindowContainer.SPLITTER_WIDTH);
+			newResizeRect.x = resizePos + left.buttonPanel.getWidth() + 1;
+			newResizeRect.y = left.dockablePanel.getY() + 1;
+			newResizeRect.height = left.dockablePanel.getHeight() - 2;
+		}
+		else if(resizing == bottom)
+		{
+			resizePos = Math.min(resizePos,getHeight()
+				- bottom.buttonPanel.getHeight()
+				- top.dockablePanel.getHeight()
+				- top.buttonPanel.getHeight()
+				- PanelWindowContainer.SPLITTER_WIDTH);
+			newResizeRect.x = bottom.dockablePanel.getX() + 1;
+			newResizeRect.y = getHeight() - bottom.buttonPanel.getHeight() - resizePos
+				- PanelWindowContainer.SPLITTER_WIDTH + 2;
+			newResizeRect.width = bottom.dockablePanel.getWidth() - 2;
+		}
+		else if(resizing == right)
+		{
+			resizePos = Math.min(resizePos,getWidth()
+				- right.buttonPanel.getWidth()
+				- left.dockablePanel.getWidth()
+				- left.buttonPanel.getWidth()
+				- PanelWindowContainer.SPLITTER_WIDTH);
+			newResizeRect.x = getWidth() - right.buttonPanel.getWidth() - resizePos
+				- PanelWindowContainer.SPLITTER_WIDTH + 1;
+			newResizeRect.y = right.dockablePanel.getY() + 1;
+			newResizeRect.height = right.dockablePanel.getHeight() - 2;
+		}
+
+		Rectangle toRepaint;
+		if(resizeRect == null)
+			toRepaint = newResizeRect;
+		else
+			toRepaint = resizeRect.union(newResizeRect);
+		resizeRect = newResizeRect;
+		repaint(toRepaint);
+	} //}}}
+
+	//{{{ finishResizing() method
+	void finishResizing()
+	{
+		resizeRect = null;
+		repaint();
+	} //}}}
+
+	//}}}
+
+	//{{{ propertiesChanged() method
+	protected void propertiesChanged()
+	{
+		if(view.isPlainView())
+			return;
+
+		((DockableLayout)getLayout()).setAlternateLayout(
+			jEdit.getBooleanProperty("view.docking.alternateLayout"));
+
+		String[] windowList = factory.getRegisteredDockableWindows();
+
+		for(int i = 0; i < windowList.length; i++)
+		{
+			String dockable = windowList[i];
+			Entry entry = windows.get(dockable);
+			if (entry == null)
+			{
+				// this can happens during a plugin loading when a dockable has been registered but the window
+				// is not yet created if the plugin has some jars.
+				continue;
+			}
+			String newPosition = jEdit.getProperty(dockable
+				+ ".dock-position",FLOATING);
+			if(newPosition.equals(entry.position))
+			{
+				continue;
+			}
+
+			entry.position = newPosition;
+			if(entry.container != null)
+			{
+				entry.container.unregister(entry);
+				entry.container = null;
+				if (entry.factory.movable && (! newPosition.equals(FLOATING)))
+				{
+					if (entry.win instanceof DockableWindow)
+						((DockableWindow)entry.win).move(newPosition);
+				}
+				else
+					entry.win = null;
+			}
+
+			if(newPosition.equals(FLOATING))
+			{
+			}
+
+			else
+			{
+				if(newPosition.equals(TOP))
+					entry.container = top;
+				else if(newPosition.equals(LEFT))
+					entry.container = left;
+				else if(newPosition.equals(BOTTOM))
+					entry.container = bottom;
+				else if(newPosition.equals(RIGHT))
+					entry.container = right;
+				else
+				{
+					Log.log(Log.WARNING,this,
+						"Unknown position: "
+						+ newPosition);
+					continue;
+				}
+
+				entry.container.register(entry);
+			}
+		}
+
+		top.sortDockables();
+		left.sortDockables();
+		bottom.sortDockables();
+		right.sortDockables();
+
+		continuousLayout = UIManager.getBoolean("SplitPane.continuousLayout");
+		revalidate();
+		repaint();
+	} //}}}
+
+	//{{{ addEntry() method
+	private void addEntry(DockableWindowFactory.Window factory)
+	{
+		Entry e;
+		if(view.isPlainView())
+		{
+			// don't show menu items to dock into a plain view
+			e = new Entry(factory,FLOATING);
+		}
+		else
+		{
+			e = new Entry(factory);
+			if(e.position.equals(FLOATING))
+				/* nothing to do */;
+			else if(e.position.equals(TOP))
+				e.container = top;
+			else if(e.position.equals(LEFT))
+				e.container = left;
+			else if(e.position.equals(BOTTOM))
+				e.container = bottom;
+			else if(e.position.equals(RIGHT))
+				e.container = right;
+			else
+			{
+				Log.log(Log.WARNING,this,
+					"Unknown position: "
+					+ e.position);
+			}
+
+			if(e.container != null)
+				e.container.register(e);
+		}
+		windows.put(factory.name,e);
+	} //}}}
+
+	//{{{ getAllPluginEntries() method
+	/**
+	 * If remove is false, only remove from clones list, otherwise remove
+	 * from both entries and clones.
+	 */
+	private Iterator<Entry> getAllPluginEntries(PluginJAR plugin, boolean remove)
+	{
+		List<Entry> returnValue = new LinkedList<Entry>();
+		Iterator<Entry> iter = windows.values().iterator();
+		while(iter.hasNext())
+		{
+			Entry entry = iter.next();
+			if(entry.factory.plugin == plugin)
+			{
+				returnValue.add(entry);
+				if(remove)
+					iter.remove();
+			}
+		}
+
+		iter = clones.iterator();
+		while(iter.hasNext())
+		{
+			Entry entry = iter.next();
+			if(entry.factory.plugin == plugin)
+			{
+				returnValue.add(entry);
+				iter.remove();
+			}
+		}
+
+		return returnValue.iterator();
+	} //}}}
+
+	private boolean continuousLayout;
+
+	//{{{ Entry class
+	static class Entry
+	{
+		DockableWindowFactory.Window factory;
+
+//		String title;
+		String position;
+		DockableWindowContainer container;
+
+		// only set if open
+		JComponent win;
+
+		// only for docked
+		AbstractButton btn;
+
+		//{{{ Entry constructor
+		Entry(DockableWindowFactory.Window factory)
+		{
+			this(factory,jEdit.getProperty(factory.name
+				+ ".dock-position",FLOATING));
+		} //}}}
+
+
+		/**
+		 * @return the long title for the dockable floating window.
+		 */
+		public String longTitle()
+		{
+			String title = jEdit.getProperty(factory.name + ".longtitle");
+			if (title == null) return shortTitle();
+			else return title;
+
+		}
+
+		/**
+		 * @return The short title, for the dockable button text
+		 */
+		public String shortTitle()
+		{
+
+			String title = jEdit.getProperty(factory.name + ".title");
+			if(title == null)
+				return "NO TITLE PROPERTY: " + factory.name;
+			else
+				return title;
+		}
+
+		/**
+		 * @return A label appropriate for the title on the dock buttons.
+		 */
+		public String label()
+		{
+			String retval = jEdit.getProperty(factory.name + ".label");
+			retval = retval.replaceAll("\\$", "");
+			return retval;
+		}
+
+		//{{{ Entry constructor
+		Entry(DockableWindowFactory.Window factory, String position)
+		{
+			this.factory = factory;
+			this.position = position;
+
+			// get the title here, not in the factory constructor,
+			// since the factory might be created before a plugin's
+			// props are loaded
+
+		} //}}}
+	} //}}}
+
+	@Override
+	public void disposeDockableWindow(String name)
+	{
+		// Nothing to do here; called as a response to plugin unloading,
+		// handled differently by this implementation.
+	}
+}
diff --git a/org/gjt/sp/jedit/gui/DockableWindowManagerProvider.java b/org/gjt/sp/jedit/gui/DockableWindowManagerProvider.java
index aec5d16..9863768 100644
--- a/org/gjt/sp/jedit/gui/DockableWindowManagerProvider.java
+++ b/org/gjt/sp/jedit/gui/DockableWindowManagerProvider.java
@@ -1,26 +1,26 @@
-package org.gjt.sp.jedit.gui;
-
-import org.gjt.sp.jedit.View;
-import org.gjt.sp.jedit.View.ViewConfig;
-import org.gjt.sp.jedit.gui.DockableWindowManager.DockingLayout;
-
-
-/** jEdit's classic dockable window manager, turned into a "provider" service.
-   *
-   *  @author Shlomy Reinstein
-   *  @since jEdit 4.3pre16
-   */
-public class DockableWindowManagerProvider implements DockingFrameworkProvider
-{
-	public DockableWindowManager create(View view,
-			DockableWindowFactory instance, ViewConfig config)
-	{
-		return new DockableWindowManagerImpl(view, instance, config);
-	}
-
-	public DockingLayout createDockingLayout()
-	{
-		return new DockableWindowManagerImpl.DockableWindowConfig();
-	}
-
-}
+package org.gjt.sp.jedit.gui;
+
+import org.gjt.sp.jedit.View;
+import org.gjt.sp.jedit.View.ViewConfig;
+import org.gjt.sp.jedit.gui.DockableWindowManager.DockingLayout;
+
+
+/** jEdit's classic dockable window manager, turned into a "provider" service.
+   *
+   *  @author Shlomy Reinstein
+   *  @since jEdit 4.3pre16
+   */
+public class DockableWindowManagerProvider implements DockingFrameworkProvider
+{
+	public DockableWindowManager create(View view,
+			DockableWindowFactory instance, ViewConfig config)
+	{
+		return new DockableWindowManagerImpl(view, instance, config);
+	}
+
+	public DockingLayout createDockingLayout()
+	{
+		return new DockableWindowManagerImpl.DockableWindowConfig();
+	}
+
+}
diff --git a/org/gjt/sp/jedit/gui/DockingFrameworkProvider.java b/org/gjt/sp/jedit/gui/DockingFrameworkProvider.java
index 88682a7..2ed3d59 100644
--- a/org/gjt/sp/jedit/gui/DockingFrameworkProvider.java
+++ b/org/gjt/sp/jedit/gui/DockingFrameworkProvider.java
@@ -1,22 +1,22 @@
-package org.gjt.sp.jedit.gui;
-
-import org.gjt.sp.jedit.View;
-import org.gjt.sp.jedit.View.ViewConfig;
-import org.gjt.sp.jedit.gui.DockableWindowManager.DockingLayout;
-
-
-/** Base interface for the Docking Framework Provider service.
-  *
-  *  Plugins such as MyDoggy can offer an alternate docking framework
-  *  by offering a service that creates an instance of one of these.
-  *  For an example, see jEdit's own services.xml, which  provides jEdit's classic
-  *  docking framework via the class DockableWindowManagerProvider.
-  *
-  *  @since jEdit 4.3pre16
-  *  @author Shlomy Reinstein
-  */
-public interface DockingFrameworkProvider {
-	DockableWindowManager create(View view, DockableWindowFactory instance,
-			ViewConfig config);
-	DockingLayout createDockingLayout();
-}
+package org.gjt.sp.jedit.gui;
+
+import org.gjt.sp.jedit.View;
+import org.gjt.sp.jedit.View.ViewConfig;
+import org.gjt.sp.jedit.gui.DockableWindowManager.DockingLayout;
+
+
+/** Base interface for the Docking Framework Provider service.
+  *
+  *  Plugins such as MyDoggy can offer an alternate docking framework
+  *  by offering a service that creates an instance of one of these.
+  *  For an example, see jEdit's own services.xml, which  provides jEdit's classic
+  *  docking framework via the class DockableWindowManagerProvider.
+  *
+  *  @since jEdit 4.3pre16
+  *  @author Shlomy Reinstein
+  */
+public interface DockingFrameworkProvider {
+	DockableWindowManager create(View view, DockableWindowFactory instance,
+			ViewConfig config);
+	DockingLayout createDockingLayout();
+}
diff --git a/org/gjt/sp/jedit/gui/DockingLayoutManager.java b/org/gjt/sp/jedit/gui/DockingLayoutManager.java
index db67d4c..00835e1 100644
--- a/org/gjt/sp/jedit/gui/DockingLayoutManager.java
+++ b/org/gjt/sp/jedit/gui/DockingLayoutManager.java
@@ -1,272 +1,282 @@
-package org.gjt.sp.jedit.gui;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.swing.JOptionPane;
-
-import org.gjt.sp.jedit.ActionSet;
-import org.gjt.sp.jedit.Buffer;
-import org.gjt.sp.jedit.EBComponent;
-import org.gjt.sp.jedit.EBMessage;
-import org.gjt.sp.jedit.EditAction;
-import org.gjt.sp.jedit.EditBus;
-import org.gjt.sp.jedit.Mode;
-import org.gjt.sp.jedit.View;
-import org.gjt.sp.jedit.jEdit;
-import org.gjt.sp.jedit.gui.DockableWindowManager.DockingLayout;
-import org.gjt.sp.jedit.msg.BufferUpdate;
-import org.gjt.sp.jedit.msg.EditPaneUpdate;
-import org.gjt.sp.jedit.msg.ViewUpdate;
-import org.gjt.sp.jedit.options.DockingOptionPane;
-
-/** Saves and loads dockable layouts to disk
-    @author Shlomy Reinstein
-    @since jEdit 4.3pre16
-*/
-public class DockingLayoutManager implements EBComponent
-{
-
-	private static final String NO_SETTINGS_MESSAGE = "no-settings.message";
-	private static final String SAVE_LAYOUT_FAILED = "save-layout-failed.message";
-	private static final String LOAD_LAYOUT_TITLE = "load-layout.title";
-	private static final String LOAD_LAYOUT_MESSAGE = "load-layout.message";
-	private static final String SAVE_LAYOUT_TITLE = "save-layout.title";
-	private static final String SAVE_LAYOUT_MESSAGE = "save-layout.message";
-	private static ActionSet actions;
-	private static DockingLayoutManager instance;
-	private Map<View, String> currentMode;
-	
-	private DockingLayoutManager()
-	{
-		currentMode = new HashMap<View, String>();
-	}
-	private static boolean save(View view, String layoutName)
-	{
-		DockingLayout docking = view.getViewConfig().docking; 
-		if (docking != null)
-		{
-			boolean ret = docking.saveLayout(layoutName, DockingLayout.NO_VIEW_INDEX);
-			if (! ret)
-				return false;
-			addAction(layoutName);
-		}
-		return true;
-	}
-	
-	public static void saveAs(View view)
-	{
-		if (jEdit.getSettingsDirectory() == null)
-		{
-			JOptionPane.showMessageDialog(view, jEdit.getProperty(NO_SETTINGS_MESSAGE));
-			return;
-		}
-		String layoutName = JOptionPane.showInputDialog(view,
-			jEdit.getProperty(SAVE_LAYOUT_MESSAGE),
-			jEdit.getProperty(SAVE_LAYOUT_TITLE),
-			JOptionPane.QUESTION_MESSAGE);
-		if (layoutName == null)
-			return;
-		if (! save(view, layoutName))
-			JOptionPane.showMessageDialog(view, jEdit.getProperty(SAVE_LAYOUT_FAILED));
-	}
-	
-	private static void load(View view, String layoutName)
-	{
-		DockingLayout docking = View.getDockingFrameworkProvider().createDockingLayout();
-		if (docking.loadLayout(layoutName, DockingLayout.NO_VIEW_INDEX))
-			view.getDockableWindowManager().setDockingLayout(docking);
-	}
-	
-	public static void load(View view)
-	{
-		if (jEdit.getSettingsDirectory() == null)
-		{
-			JOptionPane.showMessageDialog(view, jEdit.getProperty(NO_SETTINGS_MESSAGE));
-			return;
-		}
-		String layoutName = (String) JOptionPane.showInputDialog(view,
-			jEdit.getProperty(LOAD_LAYOUT_MESSAGE),
-			jEdit.getProperty(LOAD_LAYOUT_TITLE),
-			JOptionPane.QUESTION_MESSAGE,
-			null,
-			getSavedLayouts(),
-			null);
-		if (layoutName == null)
-			return;
-		load(view, layoutName);
-	}
-
-	private static String[] getSavedLayouts()
-	{
-		DockingLayout docking = View.getDockingFrameworkProvider().createDockingLayout();
-		String[] layouts = null;
-		if (docking != null)
-			layouts = docking.getSavedLayouts();
-		if (layouts == null)
-			return new String[0];
-		return layouts;
-	}
-	
-	private static void addAction(String layoutName)
-	{
-		if ((actions != null) && (! actions.contains(layoutName)))
-			actions.addAction(new LoadPerspectiveAction(layoutName));
-	}
-	
-	public static void init()
-	{
-		createActions();
-		instance = new DockingLayoutManager();
-		EditBus.addToBus(instance);
-	}
-	
-	private static void createActions()
-	{
-		actions = new ActionSet("Docking Layouts");
-		String[] layouts = getSavedLayouts();
-		for (String layout: layouts)
-			addAction(layout);
-		jEdit.addActionSet(actions);
-		actions.initKeyBindings();
-	}
-	
-	public static void removeActions()
-	{
-		jEdit.removeActionSet(actions);
-	}
-
-	private static class LoadPerspectiveAction extends EditAction
-	{
-		private static final String LOAD_PREFIX = "load-";
-
-		public LoadPerspectiveAction(String layoutName)
-		{
-			super(LOAD_PREFIX + layoutName, new String[] { layoutName });
-			jEdit.setTemporaryProperty(LOAD_PREFIX + layoutName + ".label", LOAD_PREFIX + layoutName);
-		}
-		
-		@Override
-		public void invoke(View view)
-		{
-			DockingLayoutManager.load(view, (String) args[0]);
-		}
-	}
-
-	private boolean canChangeEditMode(EBMessage message)
-	{
-		if (message instanceof BufferUpdate)
-		{
-			BufferUpdate bu = (BufferUpdate) message;
-			Object what = bu.getWhat();
-			if ((what == BufferUpdate.CLOSED) ||
-				(what == BufferUpdate.CREATED) ||
-				(what == BufferUpdate.PROPERTIES_CHANGED))
-			{
-				return true;
-			}
-		}
-		else if (message instanceof EditPaneUpdate)
-		{
-			EditPaneUpdate ep = (EditPaneUpdate) message;
-			Object what = ep.getWhat();
-			if ((what == EditPaneUpdate.BUFFER_CHANGED) ||
-				(what == EditPaneUpdate.CREATED))
-			{
-				return true;
-			}
-		}
-		return false;
-	}
-
-	public void handleMessage(EBMessage message)
-	{
-		boolean autoLoadModeLayout = jEdit.getBooleanProperty(
-			DockingOptionPane.AUTO_LOAD_MODE_LAYOUT_PROP, false);
-		if (! autoLoadModeLayout)
-			return;
-		if (message instanceof ViewUpdate)
-		{
-			ViewUpdate vu = (ViewUpdate) message;
-			if (vu.getWhat() == ViewUpdate.CLOSED)
-			{
-				View view = jEdit.getActiveView();
-				String mode = currentMode.get(view);
-				saveModeLayout(view, mode);
-				return;
-			}
-		}
-		// Check for a change in the edit mode
-		View view = jEdit.getActiveView();
-		if (view == null)
-			return;
-		if (! canChangeEditMode(message))
-			return;
-		String newMode = getCurrentEditMode(view);
-		String mode = currentMode.get(view);
-		boolean sameMode =
-			(mode == null && newMode == null) ||
-			(mode != null && mode.equals(newMode));
-		if (! sameMode)
-		{
-			boolean autoSaveModeLayout = jEdit.getBooleanProperty(
-				DockingOptionPane.AUTO_SAVE_MODE_LAYOUT_PROP, false);
-			if (autoSaveModeLayout)
-				saveModeLayout(view, mode);
-			currentMode.put(view, newMode);
-			loadModeLayout(view, newMode);
-		}
-	}
-
-	private String getCurrentEditMode(View view)
-	{
-		Buffer buffer = view.getBuffer();
-		if (buffer == null)
-			return null;
-		Mode bufferMode = buffer.getMode();
-		if (bufferMode == null)
-			return null;
-		return bufferMode.getName();
-	}
-
-	private static final String GLOBAL_MODE = "DEFAULT";
-	
-	private void saveModeLayout(View view, String mode)
-	{
-		String modeLayout = getModePerspective(mode);
-		if (modeLayout == null)
-			return;
-		save(view, modeLayout);
-	}
-	
-	private void loadModeLayout(View view, String mode)
-	{
-		String modeLayout = getModePerspective(mode);
-		if (modeLayout == null)
-			return;
-		load(view, modeLayout);
-	}
-
-	public static void loadCurrentModeLayout(View view)
-	{
-		if (view == null)
-			return;
-		String mode = instance.getCurrentEditMode(view);
-		instance.loadModeLayout(view, mode);
-	}
-	
-	public static void saveCurrentModeLayout(View view)
-	{
-		if (view == null)
-			return;
-		String mode = instance.getCurrentEditMode(view);
-		instance.saveModeLayout(view, mode);
-	}
-	
-	private String getModePerspective(String mode)
-	{
-		if (mode == null)
-			mode = GLOBAL_MODE;
-		return "mode-" + mode;
-	}
-}
+package org.gjt.sp.jedit.gui;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.swing.JOptionPane;
+
+import org.gjt.sp.jedit.ActionSet;
+import org.gjt.sp.jedit.Buffer;
+import org.gjt.sp.jedit.EBComponent;
+import org.gjt.sp.jedit.EBMessage;
+import org.gjt.sp.jedit.EditAction;
+import org.gjt.sp.jedit.EditBus;
+import org.gjt.sp.jedit.GUIUtilities;
+import org.gjt.sp.jedit.Mode;
+import org.gjt.sp.jedit.View;
+import org.gjt.sp.jedit.jEdit;
+import org.gjt.sp.jedit.gui.DockableWindowManager.DockingLayout;
+import org.gjt.sp.jedit.msg.BufferUpdate;
+import org.gjt.sp.jedit.msg.EditPaneUpdate;
+import org.gjt.sp.jedit.msg.ViewUpdate;
+import org.gjt.sp.jedit.options.DockingOptionPane;
+
+/** Saves and loads dockable layouts to disk
+    @author Shlomy Reinstein
+    @since jEdit 4.3pre16
+*/
+public class DockingLayoutManager implements EBComponent
+{
+
+	private static final String SAVE_LAYOUT_FAILED = "save-layout-failed.message";
+	private static final String LOAD_LAYOUT_TITLE = "load-layout.title";
+	private static final String LOAD_LAYOUT_MESSAGE = "load-layout.message";
+	private static final String SAVE_LAYOUT_TITLE = "save-layout.title";
+	private static final String SAVE_LAYOUT_MESSAGE = "save-layout.message";
+	private static ActionSet actions;
+	private static DockingLayoutManager instance;
+	private Map<View, String> currentMode;
+
+	private DockingLayoutManager()
+	{
+		currentMode = new HashMap<View, String>();
+	}
+	private static boolean save(View view, String layoutName)
+	{
+		if (jEdit.getSettingsDirectory() == null)
+		{
+			GUIUtilities.error(view,"no-settings",null);
+			return false;
+		}
+		DockingLayout docking = view.getViewConfig().docking;
+		if (docking != null)
+		{
+			boolean ret = docking.saveLayout(layoutName, DockingLayout.NO_VIEW_INDEX);
+			if (! ret)
+				return false;
+			addAction(layoutName);
+		}
+		return true;
+	}
+
+	public static void saveAs(View view)
+	{
+		if (jEdit.getSettingsDirectory() == null)
+		{
+			GUIUtilities.error(view,"no-settings",null);
+			return;
+		}
+		String layoutName = JOptionPane.showInputDialog(view,
+			jEdit.getProperty(SAVE_LAYOUT_MESSAGE),
+			jEdit.getProperty(SAVE_LAYOUT_TITLE),
+			JOptionPane.QUESTION_MESSAGE);
+		if (layoutName == null)
+			return;
+		if (! save(view, layoutName))
+			JOptionPane.showMessageDialog(view, jEdit.getProperty(SAVE_LAYOUT_FAILED));
+	}
+
+	private static void load(View view, String layoutName)
+	{
+		if (jEdit.getSettingsDirectory() == null)
+		{
+			GUIUtilities.error(view,"no-settings",null);
+			return;
+		}
+		DockingLayout docking = View.getDockingFrameworkProvider().createDockingLayout();
+		if (docking.loadLayout(layoutName, DockingLayout.NO_VIEW_INDEX))
+			view.getDockableWindowManager().setDockingLayout(docking);
+	}
+
+	public static void load(View view)
+	{
+		if (jEdit.getSettingsDirectory() == null)
+		{
+			GUIUtilities.error(view,"no-settings",null);
+			return;
+		}
+		String layoutName = (String) JOptionPane.showInputDialog(view,
+			jEdit.getProperty(LOAD_LAYOUT_MESSAGE),
+			jEdit.getProperty(LOAD_LAYOUT_TITLE),
+			JOptionPane.QUESTION_MESSAGE,
+			null,
+			getSavedLayouts(),
+			null);
+		if (layoutName == null)
+			return;
+		load(view, layoutName);
+	}
+
+	private static String[] getSavedLayouts()
+	{
+		DockingLayout docking = View.getDockingFrameworkProvider().createDockingLayout();
+		String[] layouts = null;
+		if (docking != null)
+			layouts = docking.getSavedLayouts();
+		if (layouts == null)
+			return new String[0];
+		return layouts;
+	}
+
+	private static void addAction(String layoutName)
+	{
+		if ((actions != null) && (! actions.contains(layoutName)))
+			actions.addAction(new LoadPerspectiveAction(layoutName));
+	}
+
+	public static void init()
+	{
+		createActions();
+		instance = new DockingLayoutManager();
+		EditBus.addToBus(instance);
+	}
+
+	private static void createActions()
+	{
+		actions = new ActionSet("Docking Layouts");
+		String[] layouts = getSavedLayouts();
+		for (String layout: layouts)
+			addAction(layout);
+		jEdit.addActionSet(actions);
+		actions.initKeyBindings();
+	}
+
+	public static void removeActions()
+	{
+		jEdit.removeActionSet(actions);
+	}
+
+	private static class LoadPerspectiveAction extends EditAction
+	{
+		private static final String LOAD_PREFIX = "load-";
+
+		public LoadPerspectiveAction(String layoutName)
+		{
+			super(LOAD_PREFIX + layoutName, new String[] { layoutName });
+			jEdit.setTemporaryProperty(LOAD_PREFIX + layoutName + ".label", LOAD_PREFIX + layoutName);
+		}
+
+		@Override
+		public void invoke(View view)
+		{
+			DockingLayoutManager.load(view, (String) args[0]);
+		}
+	}
+
+	private boolean canChangeEditMode(EBMessage message)
+	{
+		if (message instanceof BufferUpdate)
+		{
+			BufferUpdate bu = (BufferUpdate) message;
+			Object what = bu.getWhat();
+			if ((what == BufferUpdate.CLOSED) ||
+				(what == BufferUpdate.CREATED) ||
+				(what == BufferUpdate.PROPERTIES_CHANGED))
+			{
+				return true;
+			}
+		}
+		else if (message instanceof EditPaneUpdate)
+		{
+			EditPaneUpdate ep = (EditPaneUpdate) message;
+			Object what = ep.getWhat();
+			if ((what == EditPaneUpdate.BUFFER_CHANGED) ||
+				(what == EditPaneUpdate.CREATED))
+			{
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public void handleMessage(EBMessage message)
+	{
+		boolean autoLoadModeLayout = jEdit.getBooleanProperty(
+			DockingOptionPane.AUTO_LOAD_MODE_LAYOUT_PROP, false);
+		if (! autoLoadModeLayout)
+			return;
+		if (message instanceof ViewUpdate)
+		{
+			ViewUpdate vu = (ViewUpdate) message;
+			if (vu.getWhat() == ViewUpdate.CLOSED)
+			{
+				View view = jEdit.getActiveView();
+				String mode = currentMode.get(view);
+				saveModeLayout(view, mode);
+				return;
+			}
+		}
+		// Check for a change in the edit mode
+		View view = jEdit.getActiveView();
+		if (view == null)
+			return;
+		if (! canChangeEditMode(message))
+			return;
+		String newMode = getCurrentEditMode(view);
+		String mode = currentMode.get(view);
+		boolean sameMode =
+			(mode == null && newMode == null) ||
+			(mode != null && mode.equals(newMode));
+		if (! sameMode)
+		{
+			boolean autoSaveModeLayout = jEdit.getBooleanProperty(
+				DockingOptionPane.AUTO_SAVE_MODE_LAYOUT_PROP, false);
+			if (autoSaveModeLayout)
+				saveModeLayout(view, mode);
+			currentMode.put(view, newMode);
+			loadModeLayout(view, newMode);
+		}
+	}
+
+	private String getCurrentEditMode(View view)
+	{
+		Buffer buffer = view.getBuffer();
+		if (buffer == null)
+			return null;
+		Mode bufferMode = buffer.getMode();
+		if (bufferMode == null)
+			return null;
+		return bufferMode.getName();
+	}
+
+	private static final String GLOBAL_MODE = "DEFAULT";
+
+	private void saveModeLayout(View view, String mode)
+	{
+		String modeLayout = getModePerspective(mode);
+		if (modeLayout == null)
+			return;
+		save(view, modeLayout);
+	}
+
+	private void loadModeLayout(View view, String mode)
+	{
+		String modeLayout = getModePerspective(mode);
+		if (modeLayout == null)
+			return;
+		load(view, modeLayout);
+	}
+
+	public static void loadCurrentModeLayout(View view)
+	{
+		if (view == null)
+			return;
+		String mode = instance.getCurrentEditMode(view);
+		instance.loadModeLayout(view, mode);
+	}
+
+	public static void saveCurrentModeLayout(View view)
+	{
+		if (view == null)
+			return;
+		String mode = instance.getCurrentEditMode(view);
+		instance.saveModeLayout(view, mode);
+	}
+
+	private String getModePerspective(String mode)
+	{
+		if (mode == null)
+			mode = GLOBAL_MODE;
+		return "mode-" + mode;
+	}
+}
diff --git a/org/gjt/sp/jedit/gui/DynamicContextMenuService.java b/org/gjt/sp/jedit/gui/DynamicContextMenuService.java
index 9cd8cfb..4f72134 100644
--- a/org/gjt/sp/jedit/gui/DynamicContextMenuService.java
+++ b/org/gjt/sp/jedit/gui/DynamicContextMenuService.java
@@ -1,31 +1,31 @@
-package org.gjt.sp.jedit.gui;
-
-import java.awt.event.MouseEvent;
-
-import javax.swing.JMenuItem;
-
-import org.gjt.sp.jedit.textarea.JEditTextArea;
-
-/** <p> A service that can be offered by plugins when a text area context menu item
- * needs to be offered  that is sensitive to the state of the TextArea it was requested * from. </p>
-
- * Note: this service should only be used by certain plugins that need context information at the time
- * that the context menu is requested. For all other actions, it is already possible for users to
- * add menu items to the context menu, so please do not use this service from Plugins
- * to add non-dynamic actions to the context menu.
- *
- * @author ezust
- * @since jEdit 4.3pre15
- */
-abstract public class DynamicContextMenuService {
-	/**
-	 *
-	 * @param ta the TextArea where the context menu was requested.
-	 * 	   Use this to determine the location of the caret, or the edit mode of the buffer, etc.
-	 * @param evt a mouseEvent that triggered this menu request, or null
-	 * @return an array of menu items
-	 *         or null if there are no appropriate actions to be added at this time
-	 */
-	public abstract JMenuItem[] createMenu(JEditTextArea ta, MouseEvent evt);
-
-}
+package org.gjt.sp.jedit.gui;
+
+import java.awt.event.MouseEvent;
+
+import javax.swing.JMenuItem;
+
+import org.gjt.sp.jedit.textarea.JEditTextArea;
+
+/** <p> A service that can be offered by plugins when a text area context menu item
+ * needs to be offered  that is sensitive to the state of the TextArea it was requested * from. </p>
+
+ * Note: this service should only be used by certain plugins that need context information at the time
+ * that the context menu is requested. For all other actions, it is already possible for users to
+ * add menu items to the context menu, so please do not use this service from Plugins
+ * to add non-dynamic actions to the context menu.
+ *
+ * @author ezust
+ * @since jEdit 4.3pre15
+ */
+abstract public class DynamicContextMenuService {
+	/**
+	 *
+	 * @param ta the TextArea where the context menu was requested.
+	 * 	   Use this to determine the location of the caret, or the edit mode of the buffer, etc.
+	 * @param evt a mouseEvent that triggered this menu request, or null
+	 * @return an array of menu items
+	 *         or null if there are no appropriate actions to be added at this time
+	 */
+	public abstract JMenuItem[] createMenu(JEditTextArea ta, MouseEvent evt);
+
+}
diff --git a/org/gjt/sp/jedit/gui/EditAbbrevDialog.java b/org/gjt/sp/jedit/gui/EditAbbrevDialog.java
index 263c89c..088456f 100644
--- a/org/gjt/sp/jedit/gui/EditAbbrevDialog.java
+++ b/org/gjt/sp/jedit/gui/EditAbbrevDialog.java
@@ -1,6 +1,6 @@
 /*
  * EditAbbrevDialog.java - Displayed when editing abbrevs
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/EnhancedButton.java b/org/gjt/sp/jedit/gui/EnhancedButton.java
index aa63f17..fa21c5e 100644
--- a/org/gjt/sp/jedit/gui/EnhancedButton.java
+++ b/org/gjt/sp/jedit/gui/EnhancedButton.java
@@ -1,6 +1,6 @@
 /*
  * EnhancedButton.java - Tool bar button
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/ErrorListDialog.java b/org/gjt/sp/jedit/gui/ErrorListDialog.java
index 4db7411..a302b0f 100644
--- a/org/gjt/sp/jedit/gui/ErrorListDialog.java
+++ b/org/gjt/sp/jedit/gui/ErrorListDialog.java
@@ -1,6 +1,6 @@
 /*
  * ErrorListDialog.java - Used to list I/O and plugin load errors
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/ExtendedGridLayout.java b/org/gjt/sp/jedit/gui/ExtendedGridLayout.java
index fbc6bc8..aec22df 100644
--- a/org/gjt/sp/jedit/gui/ExtendedGridLayout.java
+++ b/org/gjt/sp/jedit/gui/ExtendedGridLayout.java
@@ -1,7 +1,7 @@
 /*
  * ExtendedGridLayout.java - a grid layout manager with variable cell sizes
  * that supports colspans and rowspans
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Originally written by Björn Kautler for the jEdit project. This work has been
diff --git a/org/gjt/sp/jedit/gui/ExtendedGridLayoutConstraints.java b/org/gjt/sp/jedit/gui/ExtendedGridLayoutConstraints.java
index 437afc1..a29cbc0 100644
--- a/org/gjt/sp/jedit/gui/ExtendedGridLayoutConstraints.java
+++ b/org/gjt/sp/jedit/gui/ExtendedGridLayoutConstraints.java
@@ -1,6 +1,6 @@
 /*
  * ExtendedGridLayoutConstraints.java - a constraints clss for the ExtendedGridLayout
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Originally written by Björn Kautler for the jEdit project. This work has been
diff --git a/org/gjt/sp/jedit/gui/FilePropertiesDialog.java b/org/gjt/sp/jedit/gui/FilePropertiesDialog.java
index 2bf6de2..8e742d8 100644
--- a/org/gjt/sp/jedit/gui/FilePropertiesDialog.java
+++ b/org/gjt/sp/jedit/gui/FilePropertiesDialog.java
@@ -1,362 +1,362 @@
-/*
- * FilePropertiesDialog.java - A File property dialog
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2008 VladimirR
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-package org.gjt.sp.jedit.gui;
-
-//{{{ Imports
-import java.io.File;
-
-import java.awt.BorderLayout;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.swing.*;
-import javax.swing.border.Border;
-import javax.swing.border.EmptyBorder;
-
-import org.gjt.sp.jedit.GUIUtilities;
-import org.gjt.sp.jedit.OperatingSystem;
-import org.gjt.sp.jedit.io.FavoritesVFS;
-import org.gjt.sp.jedit.io.VFS;
-import org.gjt.sp.jedit.jEdit;
-import org.gjt.sp.jedit.View;
-import org.gjt.sp.jedit.browser.VFSBrowser;
-import org.gjt.sp.jedit.io.VFSFile;
-import org.gjt.sp.jedit.io.FileVFS.LocalFile;
-import org.gjt.sp.util.IOUtilities;
-import org.gjt.sp.util.StandardUtilities;
-//}}}
-
-/**
- * File's Properties dialog. This class create and show a window from the selected file or files.
- */
-public class FilePropertiesDialog extends EnhancedDialog
-{
-	private final VFSBrowser browser;
-	private final VFSFile[] selectedFiles;
-	private final VFSFile local;
-
-	//{{{ FilePropertiesDialog(View view, VFSBrowser browser) constructor
-	/**
-	 * The FilePropertiesDialog's constructor
-	 * @param view The view
-	 * @param browser The VFSBrowser
-	 */
-	public FilePropertiesDialog(View view, VFSBrowser browser, VFSFile[] files)
-	{
-		super(view,jEdit.getProperty("vfs.browser.properties.title"),true);
-		GUIUtilities.loadGeometry(this,"propdialog");
-
-		this.browser = browser;
-
-		if (files.length > 0)
-			selectedFiles = files;
-		else
-			selectedFiles = browser.getSelectedFiles();
-		local = selectedFiles[0];
-		createAndShowGUI();
-	} //}}}
-
-	//{{{ addComponentsToPane() method
-	public void addComponentsToPane()
-	{
-		JPanel content = new JPanel(new BorderLayout());
-		content.setBorder(new EmptyBorder(12,5,0,5));
-		setContentPane(content);
-
-		if (selectedFiles.length == 1)
-		{
-			content.add(BorderLayout.NORTH, createNorthPanel());
-			content.add(BorderLayout.CENTER, createCenterPanel());
-			content.add(BorderLayout.SOUTH, createSouthPanel());
-		}
-		else if(selectedFiles.length > 1)
-		{
-			content.add(BorderLayout.NORTH, createNorthPanelAll());
-			content.add(BorderLayout.CENTER, createCenterPanelAll());
-			content.add(BorderLayout.SOUTH, createSouthPanelAll());
-		}
-	} //}}}
-
-	//{{{createNorthPanelAll() method
-	public JPanel createNorthPanelAll()
-	{
-		JPanel northPanel = new JPanel(new BorderLayout());
-
-		infoIcon = new JLabel();
-		infoIcon.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
-		northPanel.add(BorderLayout.WEST, infoIcon);
-
-		int filesCounter = 0;
-		int directoriesCounter = 0;
-		for(int i=0;i<selectedFiles.length;i++)
-		{
-			if(selectedFiles[i].getType() == VFSFile.DIRECTORY)
-			{
-				directoriesCounter++;
-			}
-			else if(selectedFiles[i].getType() == VFSFile.FILE)
-			{
-				filesCounter++;
-			}
-		}
-		JPanel nameField = new JPanel();
-		nameField.add(new JLabel(jEdit.getProperty("fileprop.selectedFiles")+": "+filesCounter+", "+
-							jEdit.getProperty("fileprop.selectedDirectories")+": "+directoriesCounter));
-
-		northPanel.add(BorderLayout.CENTER, nameField);
-		northPanel.add(BorderLayout.SOUTH, new JPanel());
-
-		return northPanel;
-	} //}}}
-
-	//{{{createCenterPanelAll() method
-	public JPanel createCenterPanelAll()
-	{
-		long filesSize = 0L;
-		JPanel centerPanel = new JPanel(new BorderLayout());
-
-		for (int i=0;i<selectedFiles.length;i++)
-		{
-			if(selectedFiles[i].getType() == VFSFile.DIRECTORY)
-			{
-				File ioFile = new File(selectedFiles[i].getPath());
-				filesSize += IOUtilities.fileLength(ioFile);
-			}
-			else if(selectedFiles[i].getType() == VFSFile.FILE)
-			{
-				filesSize += selectedFiles[i].getLength();
-			}
-		}
-
-		JPanel propField = new JPanel();
-		propField.setLayout(new GridLayout(2, 1));
-		String path = local.getPath();
-		if(OperatingSystem.isWindows() || OperatingSystem.isWindows9x() || OperatingSystem.isWindowsNT())
-		{
-			path = path.substring(0, path.lastIndexOf(92)); // 92 = '\'
-		}
-		else
-		{
-			path = path.substring(0, path.lastIndexOf('/'));
-		}
-		propField.add(new JLabel(jEdit.getProperty("fileprop.path")+": "+path));
-		propField.add(new JLabel(jEdit.getProperty("fileprop.size")+": "+
-			StandardUtilities.formatFileSize(filesSize)));
-		Border etch = BorderFactory.createEtchedBorder();
-		propField.setBorder(BorderFactory.createTitledBorder(etch, jEdit.getProperty("fileprop.properties")));
-		centerPanel.add(BorderLayout.CENTER, propField);
-
-		return centerPanel;
-	} //}}}
-
-	//{{{ createSouthPanelAll() method
-	public JPanel createSouthPanelAll()
-	{
-		ButtonActionHandler actionHandler = new ButtonActionHandler();
-		JPanel southPanel = new JPanel(new BorderLayout());
-
-		JPanel buttonsField = new JPanel();
-		okButton = new JButton(jEdit.getProperty("fileprop.okBtn"));
-		buttonsField.add(okButton);
-		okButton.addActionListener(actionHandler);
-		cancelButton = new JButton(jEdit.getProperty("fileprop.cancelBtn"));
-		buttonsField.add(cancelButton);
-		cancelButton.addActionListener(actionHandler);
-
-		southPanel.add(BorderLayout.EAST, buttonsField);
-
-		return southPanel;
-	} //}}}
-
-	//{{{ createNorthPanel() method
-	public JPanel createNorthPanel()
-	{
-		JPanel northPanel = new JPanel(new BorderLayout());
-
-		infoIcon = new JLabel();
-		infoIcon.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
-		northPanel.add(BorderLayout.WEST, infoIcon);
-
-		JPanel nameField = new JPanel();
-		nameField.add(new JLabel(jEdit.getProperty("fileprop.name")+": "));
-		String filename;
-		if (local instanceof FavoritesVFS.Favorite)
-		{
-			FavoritesVFS.Favorite favorite = (FavoritesVFS.Favorite) local;
-			filename = favorite.getLabel();
-		}
-		else
-		{
-			filename = local.getName();
-		}
-		nameTextField = new JTextField(filename, 20);
-		if ((local.getVFS().getCapabilities() & VFS.RENAME_CAP) == 0)
-		{
-			// If the VFS cannot rename, the nameTextField is non editable
-			nameTextField.setEditable(false);
-		}
-		nameField.add(nameTextField);
-		northPanel.add(BorderLayout.CENTER, nameField);
-		northPanel.add(BorderLayout.SOUTH, new JPanel());
-
-		return northPanel;
-	} //}}}
-
-	//{{{ createCenterPanel() method
-	public JPanel createCenterPanel()
-	{
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
-
-		JPanel centerPanel = new JPanel(new BorderLayout());
-
-		JPanel propField = new JPanel();
-		propField.setLayout(new GridLayout(4, 1));
-		propField.add(new JLabel(jEdit.getProperty("fileprop.name")+": "+local.getName()));
-		propField.add(new JLabel(jEdit.getProperty("fileprop.path")+": "+local.getPath()));
-
-		// Show last modified property only for LocalFile
-		if (local instanceof LocalFile)
-		{
-			propField.add(new JLabel(jEdit.getProperty("fileprop.lastmod")+": "+
-				sdf.format(new Date(((LocalFile)local).getModified()))));
-		}
-		if(local.getType() == VFSFile.DIRECTORY)
-		{
-			File ioFile = new File(local.getPath());
-			propField.add(new JLabel(jEdit.getProperty("fileprop.size")+": "+
-				StandardUtilities.formatFileSize(IOUtilities.fileLength(ioFile))));
-		}
-		else
-		{
-			propField.add(new JLabel(jEdit.getProperty("fileprop.size")+": "+
-				StandardUtilities.formatFileSize(local.getLength())));
-		}
-		Border etch = BorderFactory.createEtchedBorder();
-		propField.setBorder(BorderFactory.createTitledBorder(etch, jEdit.getProperty("fileprop.properties")));
-		centerPanel.add(BorderLayout.CENTER, propField);
-
-		JPanel attributeField = new JPanel();
-		attributeField.setLayout(new GridLayout(1, 2));
-		readable = new JCheckBox(jEdit.getProperty("fileprop.readable"));
-		readable.setSelected(local.isReadable());
-		readable.setEnabled(false);
-		attributeField.add(readable);
-
-		write = new JCheckBox(jEdit.getProperty("fileprop.writeable"));
-		write.setSelected(local.isWriteable());
-		write.setEnabled(false);
-		attributeField.add(write);
-		attributeField.setBorder(BorderFactory.createTitledBorder(etch, jEdit.getProperty("fileprop.attribute")));
-		centerPanel.add(BorderLayout.SOUTH, attributeField);
-
-		return centerPanel;
-	} //}}}
-
-	//{{{ createSouthPanel() method
-	public JPanel createSouthPanel()
-	{
-		ButtonActionHandler actionHandler = new ButtonActionHandler();
-		JPanel southPanel = new JPanel(new BorderLayout());
-
-		JPanel buttonsField = new JPanel();
-		okButton = new JButton(jEdit.getProperty("fileprop.okBtn"));
-		buttonsField.add(okButton);
-		okButton.addActionListener(actionHandler);
-		cancelButton = new JButton(jEdit.getProperty("fileprop.cancelBtn"));
-		buttonsField.add(cancelButton);
-		cancelButton.addActionListener(actionHandler);
-
-		southPanel.add(BorderLayout.EAST, buttonsField);
-
-		return southPanel;
-	} //}}}
-
-	//{{{ ok() method
-	@Override
-	public void ok()
-	{
-		if(nameTextField != null)
-		{
-			VFSFile vfsFile = browser.getSelectedFiles()[0];
-			if ((vfsFile.getVFS().getCapabilities() & VFS.RENAME_CAP) != 0)
-			{
-				browser.rename(vfsFile, nameTextField.getText());
-			}
-		}
-
-		GUIUtilities.saveGeometry(this,"propdialog");
-		setVisible(false);
-	} //}}}
-
-	//{{{ cancel() method
-	@Override
-	public void cancel()
-	{
-		GUIUtilities.saveGeometry(this,"propdialog");
-		setVisible(false);
-	} //}}}
-
-	//{{{ Private members
-	private JButton okButton;
-	private JButton cancelButton;
-	private JTextField nameTextField;
-	private JLabel infoIcon;
-	private JCheckBox readable;
-	private JCheckBox write;
-
-	//{{{ createAndShowGUI() method
-	private void createAndShowGUI()
-	{
-		addComponentsToPane();
-		pack();
-
-		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
-		setFocusable(true);
-		toFront();
-		requestFocus();
-		setResizable(false);
-		setVisible(true);
-	} //}}}
-
-	//{{{ ButtonActionHandler class
-	private class ButtonActionHandler implements ActionListener
-	{
-		public void actionPerformed(ActionEvent evt)
-		{
-			Object source = evt.getSource();
-
-
-			if(source == okButton)
-			{
-				ok();
-			}
-			else if(source == cancelButton)
-			{
-				cancel();
-			}
-		}
-	} //}}}
-	//}}}
-}
+/*
+ * FilePropertiesDialog.java - A File property dialog
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2008 VladimirR
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+package org.gjt.sp.jedit.gui;
+
+//{{{ Imports
+import java.io.File;
+
+import java.awt.BorderLayout;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.swing.*;
+import javax.swing.border.Border;
+import javax.swing.border.EmptyBorder;
+
+import org.gjt.sp.jedit.GUIUtilities;
+import org.gjt.sp.jedit.OperatingSystem;
+import org.gjt.sp.jedit.io.FavoritesVFS;
+import org.gjt.sp.jedit.io.VFS;
+import org.gjt.sp.jedit.jEdit;
+import org.gjt.sp.jedit.View;
+import org.gjt.sp.jedit.browser.VFSBrowser;
+import org.gjt.sp.jedit.io.VFSFile;
+import org.gjt.sp.jedit.io.FileVFS.LocalFile;
+import org.gjt.sp.util.IOUtilities;
+import org.gjt.sp.util.StandardUtilities;
+//}}}
+
+/**
+ * File's Properties dialog. This class create and show a window from the selected file or files.
+ */
+public class FilePropertiesDialog extends EnhancedDialog
+{
+	private final VFSBrowser browser;
+	private final VFSFile[] selectedFiles;
+	private final VFSFile local;
+
+	//{{{ FilePropertiesDialog(View view, VFSBrowser browser) constructor
+	/**
+	 * The FilePropertiesDialog's constructor
+	 * @param view The view
+	 * @param browser The VFSBrowser
+	 */
+	public FilePropertiesDialog(View view, VFSBrowser browser, VFSFile[] files)
+	{
+		super(view,jEdit.getProperty("vfs.browser.properties.title"),true);
+		GUIUtilities.loadGeometry(this,"propdialog");
+
+		this.browser = browser;
+
+		if (files.length > 0)
+			selectedFiles = files;
+		else
+			selectedFiles = browser.getSelectedFiles();
+		local = selectedFiles[0];
+		createAndShowGUI();
+	} //}}}
+
+	//{{{ addComponentsToPane() method
+	public void addComponentsToPane()
+	{
+		JPanel content = new JPanel(new BorderLayout());
+		content.setBorder(new EmptyBorder(12,5,0,5));
+		setContentPane(content);
+
+		if (selectedFiles.length == 1)
+		{
+			content.add(BorderLayout.NORTH, createNorthPanel());
+			content.add(BorderLayout.CENTER, createCenterPanel());
+			content.add(BorderLayout.SOUTH, createSouthPanel());
+		}
+		else if(selectedFiles.length > 1)
+		{
+			content.add(BorderLayout.NORTH, createNorthPanelAll());
+			content.add(BorderLayout.CENTER, createCenterPanelAll());
+			content.add(BorderLayout.SOUTH, createSouthPanelAll());
+		}
+	} //}}}
+
+	//{{{createNorthPanelAll() method
+	public JPanel createNorthPanelAll()
+	{
+		JPanel northPanel = new JPanel(new BorderLayout());
+
+		infoIcon = new JLabel();
+		infoIcon.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
+		northPanel.add(BorderLayout.WEST, infoIcon);
+
+		int filesCounter = 0;
+		int directoriesCounter = 0;
+		for(int i=0;i<selectedFiles.length;i++)
+		{
+			if(selectedFiles[i].getType() == VFSFile.DIRECTORY)
+			{
+				directoriesCounter++;
+			}
+			else if(selectedFiles[i].getType() == VFSFile.FILE)
+			{
+				filesCounter++;
+			}
+		}
+		JPanel nameField = new JPanel();
+		nameField.add(new JLabel(jEdit.getProperty("fileprop.selectedFiles")+": "+filesCounter+", "+
+							jEdit.getProperty("fileprop.selectedDirectories")+": "+directoriesCounter));
+
+		northPanel.add(BorderLayout.CENTER, nameField);
+		northPanel.add(BorderLayout.SOUTH, new JPanel());
+
+		return northPanel;
+	} //}}}
+
+	//{{{createCenterPanelAll() method
+	public JPanel createCenterPanelAll()
+	{
+		long filesSize = 0L;
+		JPanel centerPanel = new JPanel(new BorderLayout());
+
+		for (int i=0;i<selectedFiles.length;i++)
+		{
+			if(selectedFiles[i].getType() == VFSFile.DIRECTORY)
+			{
+				File ioFile = new File(selectedFiles[i].getPath());
+				filesSize += IOUtilities.fileLength(ioFile);
+			}
+			else if(selectedFiles[i].getType() == VFSFile.FILE)
+			{
+				filesSize += selectedFiles[i].getLength();
+			}
+		}
+
+		JPanel propField = new JPanel();
+		propField.setLayout(new GridLayout(2, 1));
+		String path = local.getPath();
+		if(OperatingSystem.isWindows() || OperatingSystem.isWindows9x() || OperatingSystem.isWindowsNT())
+		{
+			path = path.substring(0, path.lastIndexOf(92)); // 92 = '\'
+		}
+		else
+		{
+			path = path.substring(0, path.lastIndexOf('/'));
+		}
+		propField.add(new JLabel(jEdit.getProperty("fileprop.path")+": "+path));
+		propField.add(new JLabel(jEdit.getProperty("fileprop.size")+": "+
+			StandardUtilities.formatFileSize(filesSize)));
+		Border etch = BorderFactory.createEtchedBorder();
+		propField.setBorder(BorderFactory.createTitledBorder(etch, jEdit.getProperty("fileprop.properties")));
+		centerPanel.add(BorderLayout.CENTER, propField);
+
+		return centerPanel;
+	} //}}}
+
+	//{{{ createSouthPanelAll() method
+	public JPanel createSouthPanelAll()
+	{
+		ButtonActionHandler actionHandler = new ButtonActionHandler();
+		JPanel southPanel = new JPanel(new BorderLayout());
+
+		JPanel buttonsField = new JPanel();
+		okButton = new JButton(jEdit.getProperty("fileprop.okBtn"));
+		buttonsField.add(okButton);
+		okButton.addActionListener(actionHandler);
+		cancelButton = new JButton(jEdit.getProperty("fileprop.cancelBtn"));
+		buttonsField.add(cancelButton);
+		cancelButton.addActionListener(actionHandler);
+
+		southPanel.add(BorderLayout.EAST, buttonsField);
+
+		return southPanel;
+	} //}}}
+
+	//{{{ createNorthPanel() method
+	public JPanel createNorthPanel()
+	{
+		JPanel northPanel = new JPanel(new BorderLayout());
+
+		infoIcon = new JLabel();
+		infoIcon.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
+		northPanel.add(BorderLayout.WEST, infoIcon);
+
+		JPanel nameField = new JPanel();
+		nameField.add(new JLabel(jEdit.getProperty("fileprop.name")+": "));
+		String filename;
+		if (local instanceof FavoritesVFS.Favorite)
+		{
+			FavoritesVFS.Favorite favorite = (FavoritesVFS.Favorite) local;
+			filename = favorite.getLabel();
+		}
+		else
+		{
+			filename = local.getName();
+		}
+		nameTextField = new JTextField(filename, 20);
+		if ((local.getVFS().getCapabilities() & VFS.RENAME_CAP) == 0)
+		{
+			// If the VFS cannot rename, the nameTextField is non editable
+			nameTextField.setEditable(false);
+		}
+		nameField.add(nameTextField);
+		northPanel.add(BorderLayout.CENTER, nameField);
+		northPanel.add(BorderLayout.SOUTH, new JPanel());
+
+		return northPanel;
+	} //}}}
+
+	//{{{ createCenterPanel() method
+	public JPanel createCenterPanel()
+	{
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
+
+		JPanel centerPanel = new JPanel(new BorderLayout());
+
+		JPanel propField = new JPanel();
+		propField.setLayout(new GridLayout(4, 1));
+		propField.add(new JLabel(jEdit.getProperty("fileprop.name")+": "+local.getName()));
+		propField.add(new JLabel(jEdit.getProperty("fileprop.path")+": "+local.getPath()));
+
+		// Show last modified property only for LocalFile
+		if (local instanceof LocalFile)
+		{
+			propField.add(new JLabel(jEdit.getProperty("fileprop.lastmod")+": "+
+				sdf.format(new Date(((LocalFile)local).getModified()))));
+		}
+		if(local.getType() == VFSFile.DIRECTORY)
+		{
+			File ioFile = new File(local.getPath());
+			propField.add(new JLabel(jEdit.getProperty("fileprop.size")+": "+
+				StandardUtilities.formatFileSize(IOUtilities.fileLength(ioFile))));
+		}
+		else
+		{
+			propField.add(new JLabel(jEdit.getProperty("fileprop.size")+": "+
+				StandardUtilities.formatFileSize(local.getLength())));
+		}
+		Border etch = BorderFactory.createEtchedBorder();
+		propField.setBorder(BorderFactory.createTitledBorder(etch, jEdit.getProperty("fileprop.properties")));
+		centerPanel.add(BorderLayout.CENTER, propField);
+
+		JPanel attributeField = new JPanel();
+		attributeField.setLayout(new GridLayout(1, 2));
+		readable = new JCheckBox(jEdit.getProperty("fileprop.readable"));
+		readable.setSelected(local.isReadable());
+		readable.setEnabled(false);
+		attributeField.add(readable);
+
+		write = new JCheckBox(jEdit.getProperty("fileprop.writeable"));
+		write.setSelected(local.isWriteable());
+		write.setEnabled(false);
+		attributeField.add(write);
+		attributeField.setBorder(BorderFactory.createTitledBorder(etch, jEdit.getProperty("fileprop.attribute")));
+		centerPanel.add(BorderLayout.SOUTH, attributeField);
+
+		return centerPanel;
+	} //}}}
+
+	//{{{ createSouthPanel() method
+	public JPanel createSouthPanel()
+	{
+		ButtonActionHandler actionHandler = new ButtonActionHandler();
+		JPanel southPanel = new JPanel(new BorderLayout());
+
+		JPanel buttonsField = new JPanel();
+		okButton = new JButton(jEdit.getProperty("fileprop.okBtn"));
+		buttonsField.add(okButton);
+		okButton.addActionListener(actionHandler);
+		cancelButton = new JButton(jEdit.getProperty("fileprop.cancelBtn"));
+		buttonsField.add(cancelButton);
+		cancelButton.addActionListener(actionHandler);
+
+		southPanel.add(BorderLayout.EAST, buttonsField);
+
+		return southPanel;
+	} //}}}
+
+	//{{{ ok() method
+	@Override
+	public void ok()
+	{
+		if(nameTextField != null)
+		{
+			VFSFile vfsFile = browser.getSelectedFiles()[0];
+			if ((vfsFile.getVFS().getCapabilities() & VFS.RENAME_CAP) != 0)
+			{
+				browser.rename(vfsFile, nameTextField.getText());
+			}
+		}
+
+		GUIUtilities.saveGeometry(this,"propdialog");
+		setVisible(false);
+	} //}}}
+
+	//{{{ cancel() method
+	@Override
+	public void cancel()
+	{
+		GUIUtilities.saveGeometry(this,"propdialog");
+		setVisible(false);
+	} //}}}
+
+	//{{{ Private members
+	private JButton okButton;
+	private JButton cancelButton;
+	private JTextField nameTextField;
+	private JLabel infoIcon;
+	private JCheckBox readable;
+	private JCheckBox write;
+
+	//{{{ createAndShowGUI() method
+	private void createAndShowGUI()
+	{
+		addComponentsToPane();
+		pack();
+
+		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
+		setFocusable(true);
+		toFront();
+		requestFocus();
+		setResizable(false);
+		setVisible(true);
+	} //}}}
+
+	//{{{ ButtonActionHandler class
+	private class ButtonActionHandler implements ActionListener
+	{
+		public void actionPerformed(ActionEvent evt)
+		{
+			Object source = evt.getSource();
+
+
+			if(source == okButton)
+			{
+				ok();
+			}
+			else if(source == cancelButton)
+			{
+				cancel();
+			}
+		}
+	} //}}}
+	//}}}
+}
diff --git a/org/gjt/sp/jedit/gui/FilesChangedDialog.java b/org/gjt/sp/jedit/gui/FilesChangedDialog.java
index 2bc6059..b3fa0eb 100644
--- a/org/gjt/sp/jedit/gui/FilesChangedDialog.java
+++ b/org/gjt/sp/jedit/gui/FilesChangedDialog.java
@@ -1,6 +1,6 @@
 /*
  * FilesChangedDialog.java - Files changed on disk
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -37,7 +37,7 @@ import org.gjt.sp.util.EnhancedTreeCellRenderer;
  * Files changed on disk dialog.
  *
  * @author Slava Pestov
- * @version $Id: FilesChangedDialog.java 19788 2011-08-11 00:57:19Z Vampire0 $
+ * @version $Id: FilesChangedDialog.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class FilesChangedDialog extends EnhancedDialog
 {
diff --git a/org/gjt/sp/jedit/gui/FilteredListModel.java b/org/gjt/sp/jedit/gui/FilteredListModel.java
index 1d17e71..9824371 100644
--- a/org/gjt/sp/jedit/gui/FilteredListModel.java
+++ b/org/gjt/sp/jedit/gui/FilteredListModel.java
@@ -1,6 +1,6 @@
 /*
  * FilteredTableModel.java - A Filtered table model decorator
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/FilteredTableModel.java b/org/gjt/sp/jedit/gui/FilteredTableModel.java
index 50cb58f..14bc14c 100644
--- a/org/gjt/sp/jedit/gui/FilteredTableModel.java
+++ b/org/gjt/sp/jedit/gui/FilteredTableModel.java
@@ -1,6 +1,6 @@
 /*
  * FilteredTableModel.java - A Filtered table model decorator
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Shlomy Reinstein
@@ -124,6 +124,7 @@ public abstract class FilteredTableModel<E extends TableModel> extends AbstractT
 			this.delegated.removeTableModelListener(this);
 		delegated.addTableModelListener(this);
 		this.delegated = delegated;
+		fireTableStructureChanged();
 	} //}}}
 
 	//{{{ resetFilter() method
@@ -137,7 +138,7 @@ public abstract class FilteredTableModel<E extends TableModel> extends AbstractT
 	{
 		Set<Integer> selectedIndices = saveSelection();
 		this.filter = filter;
-		if (filter != null && filter.length() > 0)
+		if (filter != null && !filter.isEmpty())
 		{
 			int size = delegated.getRowCount();
 			filter = prepareFilter(filter);
@@ -213,6 +214,7 @@ public abstract class FilteredTableModel<E extends TableModel> extends AbstractT
 	}  //}}}
 
 	//{{{ getRowCount() method
+	@Override
 	public int getRowCount()
 	{
 		if (filteredIndices == null)
@@ -221,24 +223,28 @@ public abstract class FilteredTableModel<E extends TableModel> extends AbstractT
 	} //}}}
 
 	//{{{ getColumnCount() method
+	@Override
 	public int getColumnCount()
 	{
 		return delegated.getColumnCount();
 	} //}}}
 
 	//{{{ getColumnName() method
+	@Override
 	public String getColumnName(int columnIndex)
 	{
 		return delegated.getColumnName(columnIndex);
 	} //}}}
 
 	//{{{ getColumnClass() method
+	@Override
 	public Class<?> getColumnClass(int columnIndex)
 	{
 		return delegated.getColumnClass(columnIndex);
 	} //}}}
 
 	//{{{ isCellEditable() method
+	@Override
 	public boolean isCellEditable(int rowIndex, int columnIndex)
 	{
 		int trueRowIndex = getTrueRow(rowIndex);
@@ -246,6 +252,7 @@ public abstract class FilteredTableModel<E extends TableModel> extends AbstractT
 	} //}}}
 
 	//{{{ getValueAt() method
+	@Override
 	public Object getValueAt(int rowIndex, int columnIndex)
 	{
 		int trueRowIndex = getTrueRow(rowIndex);
@@ -253,6 +260,7 @@ public abstract class FilteredTableModel<E extends TableModel> extends AbstractT
 	} //}}}
 
 	//{{{ setValueAt() method
+	@Override
 	public void setValueAt(Object aValue, int rowIndex, int columnIndex)
 	{
 		int trueRowIndex = getTrueRow(rowIndex);
@@ -296,6 +304,7 @@ public abstract class FilteredTableModel<E extends TableModel> extends AbstractT
 	 * This fine grain notification tells listeners the exact range
 	 * of cells, rows, or columns that changed.
 	 */
+	@Override
 	public void tableChanged(TableModelEvent e)
 	{
 		setFilter(filter);
diff --git a/org/gjt/sp/jedit/gui/FloatingWindowContainer.java b/org/gjt/sp/jedit/gui/FloatingWindowContainer.java
index 8b9c910..47bf278 100644
--- a/org/gjt/sp/jedit/gui/FloatingWindowContainer.java
+++ b/org/gjt/sp/jedit/gui/FloatingWindowContainer.java
@@ -1,6 +1,6 @@
 /*
  * FloatingWindowContainer.java - holds dockable windows
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2001, 2002 Slava Pestov
@@ -47,7 +47,7 @@ import org.gjt.sp.jedit.jEdit;
 /**
  * A container for dockable windows. This class should never be used
  * directly.
- * @version $Id: FloatingWindowContainer.java 13259 2008-08-10 20:54:46Z shlomy $
+ * @version $Id: FloatingWindowContainer.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.0pre1
  */
 public class FloatingWindowContainer extends JFrame implements DockableWindowContainer,
diff --git a/org/gjt/sp/jedit/gui/FontSelector.java b/org/gjt/sp/jedit/gui/FontSelector.java
index 658292e..5aa04ab 100644
--- a/org/gjt/sp/jedit/gui/FontSelector.java
+++ b/org/gjt/sp/jedit/gui/FontSelector.java
@@ -1,6 +1,6 @@
 /*
  * FontSelector.java - Font selector
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2003 Slava Pestov
@@ -40,7 +40,7 @@ import org.gjt.sp.util.Log;
 /**
  * A font chooser widget.
  * @author Slava Pestov
- * @version $Id: FontSelector.java 17430 2010-03-07 03:16:20Z vanza $
+ * @version $Id: FontSelector.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class FontSelector extends JButton
 {
diff --git a/org/gjt/sp/jedit/gui/FontSelectorDialog.java b/org/gjt/sp/jedit/gui/FontSelectorDialog.java
index f14cada..458bb45 100644
--- a/org/gjt/sp/jedit/gui/FontSelectorDialog.java
+++ b/org/gjt/sp/jedit/gui/FontSelectorDialog.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2003 Slava Pestov
@@ -38,7 +38,7 @@ import org.gjt.sp.util.Log;
  * A dialog for choosing fonts.
  *
  * @author Slava Pestov
- * @version $Id: FontSelectorDialog.java 17430 2010-03-07 03:16:20Z vanza $
+ * @version $Id: FontSelectorDialog.java 21971 2012-08-02 20:32:37Z jarekczek $
  * @since jEdit 4.4pre1
  */
 
diff --git a/org/gjt/sp/jedit/gui/GrabKeyDialog.java b/org/gjt/sp/jedit/gui/GrabKeyDialog.java
index 5f35b33..a3fac91 100644
--- a/org/gjt/sp/jedit/gui/GrabKeyDialog.java
+++ b/org/gjt/sp/jedit/gui/GrabKeyDialog.java
@@ -1,6 +1,6 @@
 /*
  * GrabKeyDialog.java - Grabs keys from the keyboard
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2002 Slava Pestov
@@ -334,6 +334,7 @@ public class GrabKeyDialog extends JDialog
 			this.isPrefix = isPrefix;
 		}
 
+		public String actionSet;
 		public String name;
 		public String label;
 		public String shortcut;
diff --git a/org/gjt/sp/jedit/gui/HistoryModel.java b/org/gjt/sp/jedit/gui/HistoryModel.java
index a20a0f3..319eb14 100644
--- a/org/gjt/sp/jedit/gui/HistoryModel.java
+++ b/org/gjt/sp/jedit/gui/HistoryModel.java
@@ -1,6 +1,6 @@
 /*
  * HistoryModel.java - History list model
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2005 Slava Pestov
@@ -39,7 +39,7 @@ import java.util.*;
  *
  * @author Slava Pestov
  * @author Eric Le Lay
- * @version $Id: HistoryModel.java 21506 2012-03-29 17:58:53Z ezust $
+ * @version $Id: HistoryModel.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class HistoryModel extends DefaultListModel
 	implements MutableListModel
diff --git a/org/gjt/sp/jedit/gui/HistoryModelSaver.java b/org/gjt/sp/jedit/gui/HistoryModelSaver.java
index 48f6d68..035c0b4 100644
--- a/org/gjt/sp/jedit/gui/HistoryModelSaver.java
+++ b/org/gjt/sp/jedit/gui/HistoryModelSaver.java
@@ -1,6 +1,6 @@
 /*
  * HistoryModelSaver.java - Interface for loading and saving of the "history" files.
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/HistoryText.java b/org/gjt/sp/jedit/gui/HistoryText.java
index 0816314..cbb2f53 100644
--- a/org/gjt/sp/jedit/gui/HistoryText.java
+++ b/org/gjt/sp/jedit/gui/HistoryText.java
@@ -1,6 +1,6 @@
 /*
  * HistoryText.java - Common code for text components with a history
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2004 Slava Pestov
@@ -34,7 +34,7 @@ import org.gjt.sp.jedit.*;
 /**
  * Controller (manager of models) for HistoryTextArea.
  * @author Slava Pestov
- * @version $Id: HistoryText.java 16341 2009-10-14 10:05:51Z kpouer $
+ * @version $Id: HistoryText.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class HistoryText
 {
diff --git a/org/gjt/sp/jedit/gui/HistoryTextArea.java b/org/gjt/sp/jedit/gui/HistoryTextArea.java
index ebc791f..cfb8676 100644
--- a/org/gjt/sp/jedit/gui/HistoryTextArea.java
+++ b/org/gjt/sp/jedit/gui/HistoryTextArea.java
@@ -1,6 +1,6 @@
 /*
  * HistoryTextArea.java - Text area with a history
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2004 Slava Pestov
@@ -37,7 +37,7 @@ import org.gjt.sp.jedit.*;
 /**
  * Text area with a history.
  * @author Slava Pestov
- * @version $Id: HistoryTextArea.java 13415 2008-08-24 09:03:09Z k_satoda $
+ * @version $Id: HistoryTextArea.java 22466 2012-11-13 07:11:13Z ezust $
  */
 public class HistoryTextArea extends JTextArea
 {
@@ -165,6 +165,10 @@ public class HistoryTextArea extends JTextArea
 					evt.consume();
 				}
 				break;
+			case KeyEvent.VK_CONTEXT_MENU:
+				controller.showPopupMenu(evt.isShiftDown());
+				evt.consume();
+				break;
 			}
 		}
 
diff --git a/org/gjt/sp/jedit/gui/HistoryTextField.java b/org/gjt/sp/jedit/gui/HistoryTextField.java
index 44e59a7..06244f1 100644
--- a/org/gjt/sp/jedit/gui/HistoryTextField.java
+++ b/org/gjt/sp/jedit/gui/HistoryTextField.java
@@ -1,6 +1,6 @@
 /*
  * HistoryTextField.java - Text field with a history
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2000, 2001 Slava Pestov
@@ -36,7 +36,7 @@ import org.gjt.sp.jedit.*;
 /** Text field with an arrow-key + drop-down accessable history.
  *
  * @author Slava Pestov
- * @version $Id: HistoryTextField.java 21502 2012-03-29 17:19:44Z ezust $
+ * @version $Id: HistoryTextField.java 22467 2012-11-13 07:20:25Z ezust $
  */
 public class HistoryTextField extends JTextField
 {
@@ -276,6 +276,10 @@ public class HistoryTextField extends JTextField
 					evt.consume();
 				}
 				break;
+			case KeyEvent.VK_CONTEXT_MENU:
+				controller.showPopupMenu(evt.isShiftDown());
+				evt.consume();
+				break;				
 			}
 		}
 
diff --git a/org/gjt/sp/jedit/gui/IOProgressMonitor.java b/org/gjt/sp/jedit/gui/IOProgressMonitor.java
deleted file mode 100644
index dc6f946..0000000
--- a/org/gjt/sp/jedit/gui/IOProgressMonitor.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * IOProgressMonitor.java - I/O progress monitor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2000, 2002 Slava Pestov
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.gui;
-
-//{{{ Imports
-import javax.swing.border.*;
-import javax.swing.*;
-import java.awt.event.*;
-import java.awt.*;
-import org.gjt.sp.jedit.io.VFSManager;
-import org.gjt.sp.jedit.*;
-import org.gjt.sp.util.*;
-//}}}
-
-/**
- * The IO progressMonitor is the panel that will show JProgressBar for
- * IO threads.
- *
- * @version $Id: IOProgressMonitor.java 17758 2010-05-07 13:20:28Z kpouer $
- */
-public class IOProgressMonitor extends JPanel
-{
-	//{{{ IOProgressMonitor constructor
-	public IOProgressMonitor()
-	{
-		super(new BorderLayout());
-		caption = new JLabel();
-		updateCaption();
-		add(BorderLayout.NORTH,caption);
-
-		threads = new ThreadProgress[VFSManager.getIOThreadPool()
-			.getThreadCount()];
-
-		Box box = new Box(BoxLayout.Y_AXIS);
-		for(int i = 0; i < threads.length; i++)
-		{
-			if(i != 0)
-				box.add(Box.createVerticalStrut(6));
-
-			threads[i] = new ThreadProgress(i);
-			box.add(threads[i]);
-		}
-
-		JPanel threadPanel = new JPanel(new BorderLayout());
-		threadPanel.setBorder(new EmptyBorder(6,6,6,6));
-		threadPanel.add(BorderLayout.NORTH,box);
-
-		add(BorderLayout.CENTER,new JScrollPane(threadPanel));
-
-		workThreadHandler = new WorkThreadHandler();
-	} //}}}
-
-	//{{{ addNotify() method
-	@Override
-	public void addNotify()
-	{
-		VFSManager.getIOThreadPool().addProgressListener(workThreadHandler);
-		super.addNotify();
-	} //}}}
-
-	//{{{ removeNotify() method
-	@Override
-	public void removeNotify()
-	{
-		VFSManager.getIOThreadPool().removeProgressListener(workThreadHandler);
-		super.removeNotify();
-	} //}}}
-
-	//{{{ Private members
-
-	//{{{ Instance variables
-	private final JLabel caption;
-	private final ThreadProgress[] threads;
-	private final WorkThreadHandler workThreadHandler;
-	//}}}
-
-	//{{{ updateCaption() method
-	private void updateCaption()
-	{
-		String[] args = { String.valueOf(VFSManager.getIOThreadPool()
-			.getRequestCount()) };
-		caption.setText(jEdit.getProperty("io-progress-monitor.caption",args));
-	} //}}}
-
-	//}}}
-
-	//{{{ WorkThreadHandler class
-	class WorkThreadHandler implements WorkThreadProgressListener
-	{
-		public void statusUpdate(WorkThreadPool threadPool, final int threadIndex)
-		{
-			ThreadUtilities.runInDispatchThread(new Runnable()
-			{
-				public void run()
-				{
-					updateCaption();
-					threads[threadIndex].update();
-				}
-			});
-		}
-
-		public void progressUpdate(WorkThreadPool threadPool, final int threadIndex)
-		{
-			ThreadUtilities.runInDispatchThread(new Runnable()
-			{
-				public void run()
-				{
-					updateCaption();
-					threads[threadIndex].update();
-				}
-			});
-		}
-	} //}}}
-
-	//{{{ ThreadProgress class
-	class ThreadProgress extends JPanel
-	{
-		//{{{ ThreadProgress constructor
-		ThreadProgress(int index)
-		{
-			super(new BorderLayout(12,12));
-
-			this.index = index;
-
-			Box box = new Box(BoxLayout.Y_AXIS);
-			box.add(Box.createGlue());
-			box.add(progress = new JProgressBar());
-			progress.setStringPainted(true);
-			box.add(Box.createGlue());
-			add(BorderLayout.CENTER,box);
-
-			abort = new JButton(jEdit.getProperty("io-progress-monitor.abort"));
-			abort.addActionListener(new ActionHandler());
-			add(BorderLayout.EAST,abort);
-
-			update();
-		} //}}}
-
-		//{{{ update() method
-		public void update()
-		{
-			WorkThread thread = VFSManager.getIOThreadPool().getThread(index);
-			if(thread.isRequestRunning())
-			{
-				if (progress.isIndeterminate())
-				{
-					if (thread.getProgressMaximum() != 0)
-						progress.setIndeterminate(false);
-				}
-				else if (thread.getProgressMaximum() == 0)
-					progress.setIndeterminate(true);
-				
-				abort.setEnabled(true);
-				String status = thread.getStatus();
-				if(status == null)
-					status = "";
-				progress.setString(status);
-				progress.setMaximum(thread.getProgressMaximum());
-				//System.err.println("value: " + thread.getProgressValue());
-				progress.setValue(thread.getProgressValue());
-			}
-			else
-			{
-				abort.setEnabled(false);
-				progress.setString(jEdit.getProperty("io-progress-monitor"
-					+ ".idle"));
-				progress.setIndeterminate(false);
-				progress.setValue(0);
-			}
-		} //}}}
-
-		//{{{ Private members
-		private final int index;
-		private final JProgressBar progress;
-		private final JButton abort;
-		//}}}
-
-		//{{{ ActionHandler class
-		class ActionHandler implements ActionListener
-		{
-			public void actionPerformed(ActionEvent evt)
-			{
-				if(evt.getSource() == abort)
-				{
-					int result = GUIUtilities.confirm(
-						IOProgressMonitor.this,"abort",null,
-						JOptionPane.YES_NO_OPTION,
-						JOptionPane.QUESTION_MESSAGE);
-					if(result == JOptionPane.YES_OPTION)
-					{
-						VFSManager.getIOThreadPool().getThread(index)
-							.abortCurrentRequest();
-					}
-				}
-			}
-		} //}}}
-	} //}}}
-}
diff --git a/org/gjt/sp/jedit/gui/InputHandler.java b/org/gjt/sp/jedit/gui/InputHandler.java
index 9923385..9b4eda8 100644
--- a/org/gjt/sp/jedit/gui/InputHandler.java
+++ b/org/gjt/sp/jedit/gui/InputHandler.java
@@ -1,6 +1,6 @@
 /*
  * InputHandler.java - Manages key bindings and executes actions
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2003 Slava Pestov
@@ -46,7 +46,7 @@ import java.awt.*;
  * to the implementations of this class to do so.
  *
  * @author Slava Pestov
- * @version $Id: InputHandler.java 18919 2010-11-04 10:52:55Z kpouer $
+ * @version $Id: InputHandler.java 21831 2012-06-18 22:54:17Z ezust $
  * @see org.gjt.sp.jedit.gui.DefaultInputHandler
  */
 public abstract class InputHandler extends AbstractInputHandler<EditAction>
diff --git a/org/gjt/sp/jedit/gui/JCheckBoxList.java b/org/gjt/sp/jedit/gui/JCheckBoxList.java
index 5ddefd9..18265cc 100644
--- a/org/gjt/sp/jedit/gui/JCheckBoxList.java
+++ b/org/gjt/sp/jedit/gui/JCheckBoxList.java
@@ -1,6 +1,6 @@
 /*
  * JCheckBoxList.java - A list, each item can be checked or unchecked
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2001, 2002 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java b/org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
index 77edaae..9736c19 100644
--- a/org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
+++ b/org/gjt/sp/jedit/gui/JEditHistoryModelSaver.java
@@ -1,6 +1,6 @@
 /*
  * JEditHistoryModelSaver.java -
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
@@ -98,7 +98,7 @@ public class JEditHistoryModelSaver implements HistoryModelSaver
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(in);
+			IOUtilities.closeQuietly((Closeable)in);
 		}
 		return models;
 	} //}}}
@@ -166,7 +166,7 @@ public class JEditHistoryModelSaver implements HistoryModelSaver
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(out);
+			IOUtilities.closeQuietly((Closeable)out);
 		}
 
 		historyModTime = file2.lastModified();
diff --git a/org/gjt/sp/jedit/gui/KeyEventTranslator.java b/org/gjt/sp/jedit/gui/KeyEventTranslator.java
index 80cf0dd..41df0ef 100644
--- a/org/gjt/sp/jedit/gui/KeyEventTranslator.java
+++ b/org/gjt/sp/jedit/gui/KeyEventTranslator.java
@@ -1,6 +1,6 @@
 /*
  * KeyEventTranslator.java - Hides some warts of AWT event API
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003, 2005 Slava Pestov
@@ -37,7 +37,7 @@ import org.gjt.sp.util.StandardUtilities;
  * warts in the AWT key event API.
  *
  * @author Slava Pestov
- * @version $Id: KeyEventTranslator.java 21504 2012-03-29 17:45:22Z ezust $
+ * @version $Id: KeyEventTranslator.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class KeyEventTranslator
 {
diff --git a/org/gjt/sp/jedit/gui/KeyEventWorkaround.java b/org/gjt/sp/jedit/gui/KeyEventWorkaround.java
index ef02f4a..c7aaffb 100644
--- a/org/gjt/sp/jedit/gui/KeyEventWorkaround.java
+++ b/org/gjt/sp/jedit/gui/KeyEventWorkaround.java
@@ -1,6 +1,6 @@
 /*
  * KeyEventWorkaround.java - Works around bugs in Java event handling
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2005 Slava Pestov
@@ -35,7 +35,7 @@ import org.gjt.sp.util.Log;
  * Java's keyboard handling is crap, to put it mildly.
  *
  * @author Slava Pestov
- * @version $Id: KeyEventWorkaround.java 21504 2012-03-29 17:45:22Z ezust $
+ * @version $Id: KeyEventWorkaround.java 22842 2013-03-14 21:38:44Z elberry $
  */
 public class KeyEventWorkaround
 {
@@ -297,8 +297,11 @@ public class KeyEventWorkaround
 
 			if(!Debug.ALTERNATIVE_DISPATCHER)
 			{
-				if(((modifiers & InputEvent.CTRL_MASK) != 0
-					^ (modifiers & InputEvent.ALT_MASK) != 0)
+				if((modifiers & InputEvent.CTRL_MASK) != 0
+					&& (modifiers & InputEvent.ALT_MASK) == 0
+					|| (modifiers & InputEvent.CTRL_MASK) == 0
+					&& (modifiers & InputEvent.ALT_MASK) != 0
+					&& !Debug.ALT_KEY_PRESSED_DISABLED
 					|| (modifiers & InputEvent.META_MASK) != 0)
 				{
 					return null;
diff --git a/org/gjt/sp/jedit/gui/LogViewer.java b/org/gjt/sp/jedit/gui/LogViewer.java
index 71db562..c7899cd 100644
--- a/org/gjt/sp/jedit/gui/LogViewer.java
+++ b/org/gjt/sp/jedit/gui/LogViewer.java
@@ -1,6 +1,6 @@
 /*
  * LogViewer.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2004 Slava Pestov
@@ -36,7 +36,7 @@ import org.gjt.sp.util.ThreadUtilities;
 //}}}
 
 /** Activity Log Viewer
- * @version $Id: LogViewer.java 21504 2012-03-29 17:45:22Z ezust $
+ * @version $Id: LogViewer.java 21989 2012-08-08 12:21:07Z jarekczek $
  */
 public class LogViewer extends JPanel implements DefaultFocusComponent
 {
@@ -483,6 +483,11 @@ public class LogViewer extends JPanel implements DefaultFocusComponent
 						GridBagConstraints.REMAINDER);
 
 					addComponent(Box.createVerticalStrut(11));
+					beep = new JCheckBox(jEdit.getProperty("debug.beepOnOutput.label"),
+						jEdit.getBooleanProperty("debug.beepOnOutput", false));
+					addComponent(beep);
+
+					addComponent(Box.createVerticalStrut(11));
 
 					JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
 					JButton okButton = new JButton(jEdit.getProperty("common.ok"));
@@ -533,7 +538,14 @@ public class LogViewer extends JPanel implements DefaultFocusComponent
 					jEdit.setColorProperty("log-viewer.message.warning.color", warningColor.getSelectedColor());
 					jEdit.setColorProperty("log-viewer.message.error.color", errorColor.getSelectedColor());
 
+					jEdit.setBooleanProperty("debug.beepOnOutput", beep.isSelected());
+
 					setFilter();
+					// it would be most clean to call jEdit.propertiesChanged() now
+					// which is needed since global debug.beepOnOutput flag is attached to this pane;
+					// but to avoid extra log entries, we workaround it by direct Log access
+					Log.setBeepOnOutput(beep.isSelected());
+					// jEdit.propertiesChanged();
 				}
 			};
 			setContentPane(pane);
@@ -554,6 +566,7 @@ public class LogViewer extends JPanel implements DefaultFocusComponent
 		private ColorWellButton noticeColor;
 		private ColorWellButton warningColor;
 		private ColorWellButton errorColor;
+		private JCheckBox beep;
 
 	} //}}}
 }
diff --git a/org/gjt/sp/jedit/gui/MarkerViewer.java b/org/gjt/sp/jedit/gui/MarkerViewer.java
index 094ed01..13e1c94 100644
--- a/org/gjt/sp/jedit/gui/MarkerViewer.java
+++ b/org/gjt/sp/jedit/gui/MarkerViewer.java
@@ -1,6 +1,6 @@
 /*
  * MarkerViewer.java - Dockable view of markers in the current buffer
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2004 Nicholas O'Leary
diff --git a/org/gjt/sp/jedit/gui/MutableListModel.java b/org/gjt/sp/jedit/gui/MutableListModel.java
index 1367345..cf1a2b6 100644
--- a/org/gjt/sp/jedit/gui/MutableListModel.java
+++ b/org/gjt/sp/jedit/gui/MutableListModel.java
@@ -1,6 +1,6 @@
 /*
  * MutableListModel.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/NumericTextField.java b/org/gjt/sp/jedit/gui/NumericTextField.java
index 159e965..65b9c60 100644
--- a/org/gjt/sp/jedit/gui/NumericTextField.java
+++ b/org/gjt/sp/jedit/gui/NumericTextField.java
@@ -1,6 +1,6 @@
 /*
  * NumericTextField.java - A TextField that accepts only numeric values
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/OptionsDialog.java b/org/gjt/sp/jedit/gui/OptionsDialog.java
index 7356651..adbd903 100644
--- a/org/gjt/sp/jedit/gui/OptionsDialog.java
+++ b/org/gjt/sp/jedit/gui/OptionsDialog.java
@@ -1,6 +1,6 @@
 /*
  * OptionsDialog.java - Tree options dialog
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2003 Slava Pestov
@@ -41,7 +41,7 @@ import org.gjt.sp.util.Log;
 
 /** An abstract options dialog box.
  * @author Slava Pestov
- * @version $Id: OptionsDialog.java 21586 2012-04-17 16:36:42Z ezust $
+ * @version $Id: OptionsDialog.java 21831 2012-06-18 22:54:17Z ezust $
  * @todo refactor to use OptionGroupPane
  */
 public abstract class OptionsDialog extends EnhancedDialog
diff --git a/org/gjt/sp/jedit/gui/PanelWindowContainer.java b/org/gjt/sp/jedit/gui/PanelWindowContainer.java
index 166f605..9f24793 100644
--- a/org/gjt/sp/jedit/gui/PanelWindowContainer.java
+++ b/org/gjt/sp/jedit/gui/PanelWindowContainer.java
@@ -1,6 +1,6 @@
 /*
  * PanelWindowContainer.java - holds dockable windows
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2004 Slava Pestov
@@ -72,7 +72,7 @@ import org.gjt.sp.util.StandardUtilities;
 /** A container for dockable windows. This class should never be used
  * directly.
  * @author Slava Pestov
- * @version $Id: PanelWindowContainer.java 21504 2012-03-29 17:45:22Z ezust $
+ * @version $Id: PanelWindowContainer.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.0pre1
  */
 public class PanelWindowContainer implements DockableWindowContainer, DockingArea
diff --git a/org/gjt/sp/jedit/gui/PasteFromListDialog.java b/org/gjt/sp/jedit/gui/PasteFromListDialog.java
index 2dadee6..83c1a07 100644
--- a/org/gjt/sp/jedit/gui/PasteFromListDialog.java
+++ b/org/gjt/sp/jedit/gui/PasteFromListDialog.java
@@ -1,6 +1,6 @@
 /*
  * PasteFromListDialog.java - Paste previous/paste deleted dialog
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003, 2005 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/PasteSpecialDialog.java b/org/gjt/sp/jedit/gui/PasteSpecialDialog.java
index 8208b1b..4b831cd 100644
--- a/org/gjt/sp/jedit/gui/PasteSpecialDialog.java
+++ b/org/gjt/sp/jedit/gui/PasteSpecialDialog.java
@@ -1,154 +1,154 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 jEdit contributors
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.gui;
-
-import org.gjt.sp.jedit.Registers;
-import org.gjt.sp.jedit.View;
-import org.gjt.sp.jedit.datatransfer.JEditDataFlavor;
-import org.gjt.sp.jedit.jEdit;
-import org.gjt.sp.jedit.textarea.TextArea;
-
-import javax.swing.*;
-import javax.swing.border.EmptyBorder;
-import java.awt.*;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.*;
-import java.util.List;
-
-/** "Paste Special" dialog.
- * @author Matthieu Casanova
- */
-public class PasteSpecialDialog extends EnhancedDialog
-{
-		private static final DataFlavor[] flavors = {DataFlavor.stringFlavor,
-				JEditDataFlavor.jEditRichTextDataFlavor, JEditDataFlavor.html};
-
-		private final TextArea textArea;
-		private final JButton ok;
-
-		private final JButton cancel;
-		private JList flavorList;
-
-		public PasteSpecialDialog(View view, TextArea textArea)
-		{
-				super(view, jEdit.getProperty("paste-special.title"), true);
-				this.textArea = textArea;
-				JPanel content = new JPanel(new BorderLayout());
-				content.setBorder(new EmptyBorder(12,12,12,12));
-				setContentPane(content);
-				Registers.Register register = Registers.getRegister('$');
-				Transferable transferable = register.getTransferable();
-				DataFlavor[] flavors = transferable.getTransferDataFlavors();
-				List<DataFlavor> flavorList = Arrays.asList(flavors);
-				Vector<DataFlavor> supportedFlavors = new Vector<DataFlavor>(this.flavors.length);
-				for (DataFlavor flavor : this.flavors)
-				{
-						if (flavorList.contains(flavor))
-						{
-								supportedFlavors.add(flavor);
-						}
-				}
-				this.flavorList = new JList(supportedFlavors);
-				this.flavorList.setCellRenderer(new DefaultListCellRenderer()
-				{
-						@Override
-						public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
-						{
-								super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
-								if (value.equals(DataFlavor.stringFlavor))
-								{
-										setText("Plain text");
-								}
-								else if (value.equals(JEditDataFlavor.jEditRichTextDataFlavor))
-								{
-										setText("jEdit rich text");
-								}
-								else if (value.equals(JEditDataFlavor.html))
-								{
-										setText("html");
-								}
-								return this;
-						}
-				});
-				getContentPane().add(new JScrollPane(this.flavorList));
-
-				//{{{ Buttons
-
-				JPanel buttons = new JPanel();
-				buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS));
-				buttons.setBorder(new EmptyBorder(12,0,0,0));
-				buttons.add(Box.createGlue());
-
-				ok = new JButton(jEdit.getProperty("common.ok"));
-				ok.addActionListener(new ActionListener()
-				{
-						public void actionPerformed(ActionEvent e)
-						{
-								ok();
-						}
-				});
-				getRootPane().setDefaultButton(ok);
-				buttons.add(ok);
-
-				buttons.add(Box.createHorizontalStrut(6));
-
-				cancel = new JButton(jEdit.getProperty("common.cancel"));
-				cancel.addActionListener(new ActionListener()
-				{
-						public void actionPerformed(ActionEvent e)
-						{
-								cancel();
-						}
-				});
-				buttons.add(cancel);
-
-				buttons.add(Box.createGlue());
-				content.add(BorderLayout.SOUTH,buttons);
-
-				//}}}
-
-				pack();
-				setLocationRelativeTo(view);
-				setVisible(true);
-		}
-
-		@Override
-		public void ok()
-		{
-				DataFlavor flavor = (DataFlavor) flavorList.getSelectedValue();
-				if (flavor == null)
-				{
-						flavor = DataFlavor.stringFlavor;
-				}
-				Registers.paste(textArea, '$', flavor);
-				dispose();
-		}
-
-		@Override
-		public void cancel()
-		{
-				dispose();
-		}
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010 jEdit contributors
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.gui;
+
+import org.gjt.sp.jedit.Registers;
+import org.gjt.sp.jedit.View;
+import org.gjt.sp.jedit.datatransfer.JEditDataFlavor;
+import org.gjt.sp.jedit.jEdit;
+import org.gjt.sp.jedit.textarea.TextArea;
+
+import javax.swing.*;
+import javax.swing.border.EmptyBorder;
+import java.awt.*;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.*;
+import java.util.List;
+
+/** "Paste Special" dialog.
+ * @author Matthieu Casanova
+ */
+public class PasteSpecialDialog extends EnhancedDialog
+{
+		private static final DataFlavor[] flavors = {DataFlavor.stringFlavor,
+				JEditDataFlavor.jEditRichTextDataFlavor, JEditDataFlavor.html};
+
+		private final TextArea textArea;
+		private final JButton ok;
+
+		private final JButton cancel;
+		private JList flavorList;
+
+		public PasteSpecialDialog(View view, TextArea textArea)
+		{
+				super(view, jEdit.getProperty("paste-special.title"), true);
+				this.textArea = textArea;
+				JPanel content = new JPanel(new BorderLayout());
+				content.setBorder(new EmptyBorder(12,12,12,12));
+				setContentPane(content);
+				Registers.Register register = Registers.getRegister('$');
+				Transferable transferable = register.getTransferable();
+				DataFlavor[] flavors = transferable.getTransferDataFlavors();
+				List<DataFlavor> flavorList = Arrays.asList(flavors);
+				Vector<DataFlavor> supportedFlavors = new Vector<DataFlavor>(this.flavors.length);
+				for (DataFlavor flavor : this.flavors)
+				{
+						if (flavorList.contains(flavor))
+						{
+								supportedFlavors.add(flavor);
+						}
+				}
+				this.flavorList = new JList(supportedFlavors);
+				this.flavorList.setCellRenderer(new DefaultListCellRenderer()
+				{
+						@Override
+						public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
+						{
+								super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+								if (value.equals(DataFlavor.stringFlavor))
+								{
+										setText("Plain text");
+								}
+								else if (value.equals(JEditDataFlavor.jEditRichTextDataFlavor))
+								{
+										setText("jEdit rich text");
+								}
+								else if (value.equals(JEditDataFlavor.html))
+								{
+										setText("html");
+								}
+								return this;
+						}
+				});
+				getContentPane().add(new JScrollPane(this.flavorList));
+
+				//{{{ Buttons
+
+				JPanel buttons = new JPanel();
+				buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS));
+				buttons.setBorder(new EmptyBorder(12,0,0,0));
+				buttons.add(Box.createGlue());
+
+				ok = new JButton(jEdit.getProperty("common.ok"));
+				ok.addActionListener(new ActionListener()
+				{
+						public void actionPerformed(ActionEvent e)
+						{
+								ok();
+						}
+				});
+				getRootPane().setDefaultButton(ok);
+				buttons.add(ok);
+
+				buttons.add(Box.createHorizontalStrut(6));
+
+				cancel = new JButton(jEdit.getProperty("common.cancel"));
+				cancel.addActionListener(new ActionListener()
+				{
+						public void actionPerformed(ActionEvent e)
+						{
+								cancel();
+						}
+				});
+				buttons.add(cancel);
+
+				buttons.add(Box.createGlue());
+				content.add(BorderLayout.SOUTH,buttons);
+
+				//}}}
+
+				pack();
+				setLocationRelativeTo(view);
+				setVisible(true);
+		}
+
+		@Override
+		public void ok()
+		{
+				DataFlavor flavor = (DataFlavor) flavorList.getSelectedValue();
+				if (flavor == null)
+				{
+						flavor = DataFlavor.stringFlavor;
+				}
+				Registers.paste(textArea, '$', flavor);
+				dispose();
+		}
+
+		@Override
+		public void cancel()
+		{
+				dispose();
+		}
+}
diff --git a/org/gjt/sp/jedit/gui/PingPongList.java b/org/gjt/sp/jedit/gui/PingPongList.java
index eab668a..d0c4695 100644
--- a/org/gjt/sp/jedit/gui/PingPongList.java
+++ b/org/gjt/sp/jedit/gui/PingPongList.java
@@ -1,455 +1,455 @@
-/*
- * PingPongList.java - Ping Pong List
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010, 2011 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.gui;
-
-//{{{ Imports
-import org.gjt.sp.util.Log;
-
-import javax.swing.*;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-import java.awt.*;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import static javax.swing.Box.createHorizontalBox;
-import static javax.swing.Box.createHorizontalStrut;
-import static org.gjt.sp.jedit.jEdit.getProperty;
-//}}}
-
-/** A panel with two lists, allowing the user to move items between them.
- * All methods ensure that an element cannot appear in both lists simultaneously.
- *
- * @author Matthieu Casanova
- * @since jEdit 4.4pre1
- */
-public class PingPongList<E> extends JPanel
-{
-	private final MyListModel<E> leftModel;
-	private final MyListModel<E> rightModel;
-	private JList left;
-	private JList right;
-	private JLabel leftLabel;
-	private JLabel rightLabel;
-	private JPanel leftPanel;
-	private JPanel rightPanel;
-	private JButton selectAllButton;
-	private JButton selectNoneButton;
-
-	//{{{ PingPongList constructors
-	public PingPongList(List<E> leftData, List<E> rightData)
-	{
-		this(JSplitPane.HORIZONTAL_SPLIT, leftData, rightData);
-	}
-
-	public PingPongList(int newOrientation, List<E> leftData, List<E> rightData)
-	{
-		super(new BorderLayout());
-		JSplitPane splitPane = new JSplitPane(newOrientation);
-		leftModel = new MyListModel<E>(leftData);
-		left = new JList(leftModel);
-		rightModel = new MyListModel<E>(rightData);
-		right = new JList(rightModel);
-		leftPanel = new JPanel(new BorderLayout());
-		rightPanel = new JPanel(new BorderLayout());
-		JScrollPane leftScroll = new JScrollPane(left);
-		JScrollPane rightScroll = new JScrollPane(right);
-		leftPanel.add(leftScroll);
-		rightPanel.add(rightScroll);
-		splitPane.setLeftComponent(leftPanel);
-		splitPane.setRightComponent(rightPanel);
-		left.setDragEnabled(true);
-		right.setDragEnabled(true);
-
-		MyTransferHandler myTransferHandler = new MyTransferHandler();
-		left.setTransferHandler(myTransferHandler);
-		right.setTransferHandler(myTransferHandler);
-		splitPane.setDividerLocation(0.5);
-
-		// Select All/None Buttons
-		Box buttonsBox = createHorizontalBox();
-		buttonsBox.add(createHorizontalStrut(12));
-
-		ActionListener actionHandler = new ActionHandler();
-		selectAllButton = new JButton(getProperty("common.selectAll"));
-		selectAllButton.addActionListener(actionHandler);
-		selectAllButton.setEnabled(getLeftSize() != 0);
-		buttonsBox.add(selectAllButton);
-		buttonsBox.add(createHorizontalStrut(12));
-
-		selectNoneButton = new JButton(getProperty("common.selectNone"));
-		selectNoneButton.addActionListener(actionHandler);
-		selectNoneButton.setEnabled(getRightSize() != 0);
-		buttonsBox.add(selectNoneButton);
-		buttonsBox.add(createHorizontalStrut(12));
-
-		add(splitPane, BorderLayout.CENTER);
-		add(buttonsBox, BorderLayout.SOUTH);
-
-		ListDataListener listDataListener = new MyListDataListener();
-		leftModel.addListDataListener(listDataListener);
-		rightModel.addListDataListener(listDataListener);
-	} //}}}
-
-	//{{{ setLeftTooltip() method
-	public void setLeftTooltip(String leftTooltip)
-	{
-		left.setToolTipText(leftTooltip);
-	} //}}}
-
-	//{{{ setRightTooltip() method
-	public void setRightTooltip(String rightTooltip)
-	{
-		right.setToolTipText(rightTooltip);
-	} //}}}
-
-	//{{{ setLeftTitle() method
-	public void setLeftTitle(String leftTitle)
-	{
-		if (leftTitle == null)
-		{
-			removeLeftTitle();
-			return;
-		}
-		if (leftLabel == null)
-		{
-			leftLabel = new JLabel();
-		}
-		leftLabel.setText(leftTitle);
-		leftPanel.add(leftLabel, BorderLayout.NORTH);
-	} //}}}
-
-	//{{{ setRightTitle() method
-	public void setRightTitle(String rightTitle)
-	{
-		if (rightTitle == null)
-		{
-			removeRightTitle();
-			return;
-		}
-		if (rightLabel == null)
-		{
-			rightLabel = new JLabel();
-		}
-		rightLabel.setText(rightTitle);
-		rightPanel.add(rightLabel, BorderLayout.NORTH);
-	} //}}}
-
-	//{{{ removeLeftTitle() method
-	public void removeLeftTitle()
-	{
-		if (leftLabel != null)
-		{
-			leftPanel.remove(leftLabel);
-			leftLabel = null;
-		}
-	} //}}}
-
-	//{{{ removeRightTitle() method
-	public void removeRightTitle()
-	{
-		if (rightLabel != null)
-		{
-			rightPanel.remove(rightLabel);
-			rightLabel = null;
-		}
-	} //}}}
-
-	//{{{ getLeftSize() method
-	public int getLeftSize()
-	{
-		return leftModel.getSize();
-	} //}}}
-
-	//{{{ getRightSize() method
-	public int getRightSize()
-	{
-		return rightModel.getSize();
-	} //}}}
-
-	//{{{ getLeftDataIterator() method
-	public Iterator<E> getLeftDataIterator()
-	{
-		return leftModel.iterator();
-	} //}}}
-
-	//{{{ getRightDataIterator() method
-	public Iterator<E> getRightDataIterator()
-	{
-		return rightModel.iterator();
-	} //}}}
-
-	//{{{ moveAllToLeft() method
-	public void moveAllToLeft()
-	{
-		leftModel.addAll(rightModel.data);
-		rightModel.clear();
-	} //}}}
-
-	//{{{ moveAllToRight() method
-	public void moveAllToRight()
-	{
-		rightModel.addAll(leftModel.data);
-		leftModel.clear();
-	} //}}}
-
-	//{{{ Inner classes
-
-	//{{{ MyListModel class
-	private static class MyListModel<E> extends AbstractListModel implements Iterable<E>
-	{
-		private List<E> data;
-
-		private MyListModel(List<E> data)
-		{
-			this.data = data;
-		}
-
-		@Override
-		public int getSize()
-		{
-			return data.size();
-		}
-
-		@Override
-		public Object getElementAt(int index)
-		{
-			return data.get(index);
-		}
-
-		@Override
-		public Iterator<E> iterator()
-		{
-			return data.iterator();
-		}
-
-		public void clear()
-		{
-			if (data.isEmpty())
-				return;
-			int i = data.size();
-			data.clear();
-			fireIntervalRemoved(this, 0, i - 1);
-		}
-
-		public void addAll(Collection<E> newData)
-		{
-			int i = data.size();
-			data.addAll(newData);
-			fireIntervalAdded(this, i, i + newData.size() - 1);
-		}
-
-		public void remove(int index)
-		{
-			data.remove(index);
-
-			fireContentsChanged(this, index, index);
-		}
-
-		public void add(int pos, E[] addedDatas)
-		{
-			for (int i = addedDatas.length - 1; i >= 0; i--)
-				data.add(pos, addedDatas[i]);
-
-			fireContentsChanged(this, pos, pos + addedDatas.length - 1);
-		}
-	} //}}}
-
-	//{{{ MyTransferHandler class
-	private class MyTransferHandler extends TransferHandler
-	{
-		private JList sourceList;
-		private int[]indices;
-
-		@Override
-		public int getSourceActions(JComponent c)
-		{
-			return MOVE;
-		}
-
-		@Override
-		public boolean importData(JComponent comp, Transferable t)
-		{
-			try
-			{
-				@SuppressWarnings({"unchecked"})
-				E[] transferData = (E[]) t.getTransferData(MyTransferable.javaListFlavor);
-				JList targetList = (JList) comp;
-				@SuppressWarnings({"unchecked"})
-				MyListModel<E> targetModel = (MyListModel<E>) targetList.getModel();
-				@SuppressWarnings({"unchecked"})
-				MyListModel<E> sourceModel = (MyListModel<E>) sourceList.getModel();
-				int dropLocation = targetList.getSelectedIndex();
-				if(dropLocation == -1)dropLocation=0;
-				targetModel.add(dropLocation, transferData);
-				int dropStart = dropLocation;
-				if (targetList == sourceList)
-				{
-					// we are moving inside the same list
-					for (int i = indices.length - 1; i >= 0; i--)
-					{
-						int index = indices[i];
-						if (indices[i] >= dropLocation)
-						{
-							index += transferData.length;
-						}
-						else
-						{
-							dropStart--;
-						}
-						sourceModel.remove(index);
-					}
-					for (int i = indices.length - 1; i >= 0; i--)
-					{
-						indices[i] = dropStart + i;
-					}
-				}
-				else
-				{
-					// we are moving to another list
-					sourceList.clearSelection();
-					for (int i = indices.length - 1; i >= 0; i--)
-					{
-						sourceModel.remove(indices[i]);
-						indices[i] = dropLocation + i;
-					}
-				}
-				targetList.setSelectedIndices(indices);
-				return true;
-			}
-			catch (UnsupportedFlavorException e)
-			{
-				Log.log(Log.ERROR, this, e);
-			}
-			catch (IOException e)
-			{
-				Log.log(Log.ERROR, this, e);
-			}
-			return false;
-		}
-
-		@Override
-		protected Transferable createTransferable(JComponent c)
-		{
-			sourceList = (JList) c;
-			indices = sourceList.getSelectedIndices();
-
-			@SuppressWarnings("unchecked")
-			E[] objects = (E[]) sourceList.getSelectedValues();
-			return new MyTransferable<E>(objects);
-		}
-
-		@Override
-		public boolean canImport(JComponent comp, DataFlavor[] transferFlavors)
-		{
-			return comp == left || comp == right;
-		}
-	} //}}}
-
-	//{{{ MyTransferable class
-	private static class MyTransferable<E> implements Transferable
-	{
-		public static final DataFlavor javaListFlavor = new DataFlavor(Collection.class, "java.util.Collection");
-
-		private final E[] data;
-
-		private MyTransferable(E[] data)
-		{
-			this.data = data;
-		}
-
-		@Override
-		public DataFlavor[] getTransferDataFlavors()
-		{
-			return new DataFlavor[]{javaListFlavor};
-		}
-
-		@Override
-		public boolean isDataFlavorSupported(DataFlavor flavor)
-		{
-			return flavor.equals(javaListFlavor);
-		}
-
-		@Override
-		public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
-		{
-			return data;
-		}
-	} //}}}
-
-	//{{{ ActionHandler class
-	private class ActionHandler implements ActionListener
-	{
-		@Override
-		public void actionPerformed(ActionEvent ae)
-		{
-			Object source = ae.getSource();
-			if (source == selectAllButton)
-			{
-				moveAllToRight();
-				selectAllButton.setEnabled(false);
-				selectNoneButton.setEnabled(true);
-			}
-			else if (source == selectNoneButton)
-			{
-				moveAllToLeft();
-				selectAllButton.setEnabled(true);
-				selectNoneButton.setEnabled(false);
-			}
-		}
-	} //}}}
-
-	private class MyListDataListener implements ListDataListener
-	{
-		@Override
-		public void intervalAdded(ListDataEvent e)
-		{
-			dataUpdated(e);
-		}
-
-		@Override
-		public void intervalRemoved(ListDataEvent e)
-		{
-			dataUpdated(e);
-		}
-
-		@Override
-		public void contentsChanged(ListDataEvent e)
-		{
-			dataUpdated(e);
-		}
-		
-		private void dataUpdated(ListDataEvent e)
-		{
-			selectAllButton.setEnabled(getLeftSize() != 0);
-			selectNoneButton.setEnabled(getRightSize() != 0);
-		}
-	}
-	//}}}
-}
+/*
+ * PingPongList.java - Ping Pong List
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010, 2011 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.gui;
+
+//{{{ Imports
+import org.gjt.sp.util.Log;
+
+import javax.swing.*;
+import javax.swing.event.ListDataEvent;
+import javax.swing.event.ListDataListener;
+import java.awt.*;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import static javax.swing.Box.createHorizontalBox;
+import static javax.swing.Box.createHorizontalStrut;
+import static org.gjt.sp.jedit.jEdit.getProperty;
+//}}}
+
+/** A panel with two lists, allowing the user to move items between them.
+ * All methods ensure that an element cannot appear in both lists simultaneously.
+ *
+ * @author Matthieu Casanova
+ * @since jEdit 4.4pre1
+ */
+public class PingPongList<E> extends JPanel
+{
+	private final MyListModel<E> leftModel;
+	private final MyListModel<E> rightModel;
+	private JList left;
+	private JList right;
+	private JLabel leftLabel;
+	private JLabel rightLabel;
+	private JPanel leftPanel;
+	private JPanel rightPanel;
+	private JButton selectAllButton;
+	private JButton selectNoneButton;
+
+	//{{{ PingPongList constructors
+	public PingPongList(List<E> leftData, List<E> rightData)
+	{
+		this(JSplitPane.HORIZONTAL_SPLIT, leftData, rightData);
+	}
+
+	public PingPongList(int newOrientation, List<E> leftData, List<E> rightData)
+	{
+		super(new BorderLayout());
+		JSplitPane splitPane = new JSplitPane(newOrientation);
+		leftModel = new MyListModel<E>(leftData);
+		left = new JList(leftModel);
+		rightModel = new MyListModel<E>(rightData);
+		right = new JList(rightModel);
+		leftPanel = new JPanel(new BorderLayout());
+		rightPanel = new JPanel(new BorderLayout());
+		JScrollPane leftScroll = new JScrollPane(left);
+		JScrollPane rightScroll = new JScrollPane(right);
+		leftPanel.add(leftScroll);
+		rightPanel.add(rightScroll);
+		splitPane.setLeftComponent(leftPanel);
+		splitPane.setRightComponent(rightPanel);
+		left.setDragEnabled(true);
+		right.setDragEnabled(true);
+
+		MyTransferHandler myTransferHandler = new MyTransferHandler();
+		left.setTransferHandler(myTransferHandler);
+		right.setTransferHandler(myTransferHandler);
+		splitPane.setDividerLocation(0.5);
+
+		// Select All/None Buttons
+		Box buttonsBox = createHorizontalBox();
+		buttonsBox.add(createHorizontalStrut(12));
+
+		ActionListener actionHandler = new ActionHandler();
+		selectAllButton = new JButton(getProperty("common.selectAll"));
+		selectAllButton.addActionListener(actionHandler);
+		selectAllButton.setEnabled(getLeftSize() != 0);
+		buttonsBox.add(selectAllButton);
+		buttonsBox.add(createHorizontalStrut(12));
+
+		selectNoneButton = new JButton(getProperty("common.selectNone"));
+		selectNoneButton.addActionListener(actionHandler);
+		selectNoneButton.setEnabled(getRightSize() != 0);
+		buttonsBox.add(selectNoneButton);
+		buttonsBox.add(createHorizontalStrut(12));
+
+		add(splitPane, BorderLayout.CENTER);
+		add(buttonsBox, BorderLayout.SOUTH);
+
+		ListDataListener listDataListener = new MyListDataListener();
+		leftModel.addListDataListener(listDataListener);
+		rightModel.addListDataListener(listDataListener);
+	} //}}}
+
+	//{{{ setLeftTooltip() method
+	public void setLeftTooltip(String leftTooltip)
+	{
+		left.setToolTipText(leftTooltip);
+	} //}}}
+
+	//{{{ setRightTooltip() method
+	public void setRightTooltip(String rightTooltip)
+	{
+		right.setToolTipText(rightTooltip);
+	} //}}}
+
+	//{{{ setLeftTitle() method
+	public void setLeftTitle(String leftTitle)
+	{
+		if (leftTitle == null)
+		{
+			removeLeftTitle();
+			return;
+		}
+		if (leftLabel == null)
+		{
+			leftLabel = new JLabel();
+		}
+		leftLabel.setText(leftTitle);
+		leftPanel.add(leftLabel, BorderLayout.NORTH);
+	} //}}}
+
+	//{{{ setRightTitle() method
+	public void setRightTitle(String rightTitle)
+	{
+		if (rightTitle == null)
+		{
+			removeRightTitle();
+			return;
+		}
+		if (rightLabel == null)
+		{
+			rightLabel = new JLabel();
+		}
+		rightLabel.setText(rightTitle);
+		rightPanel.add(rightLabel, BorderLayout.NORTH);
+	} //}}}
+
+	//{{{ removeLeftTitle() method
+	public void removeLeftTitle()
+	{
+		if (leftLabel != null)
+		{
+			leftPanel.remove(leftLabel);
+			leftLabel = null;
+		}
+	} //}}}
+
+	//{{{ removeRightTitle() method
+	public void removeRightTitle()
+	{
+		if (rightLabel != null)
+		{
+			rightPanel.remove(rightLabel);
+			rightLabel = null;
+		}
+	} //}}}
+
+	//{{{ getLeftSize() method
+	public int getLeftSize()
+	{
+		return leftModel.getSize();
+	} //}}}
+
+	//{{{ getRightSize() method
+	public int getRightSize()
+	{
+		return rightModel.getSize();
+	} //}}}
+
+	//{{{ getLeftDataIterator() method
+	public Iterator<E> getLeftDataIterator()
+	{
+		return leftModel.iterator();
+	} //}}}
+
+	//{{{ getRightDataIterator() method
+	public Iterator<E> getRightDataIterator()
+	{
+		return rightModel.iterator();
+	} //}}}
+
+	//{{{ moveAllToLeft() method
+	public void moveAllToLeft()
+	{
+		leftModel.addAll(rightModel.data);
+		rightModel.clear();
+	} //}}}
+
+	//{{{ moveAllToRight() method
+	public void moveAllToRight()
+	{
+		rightModel.addAll(leftModel.data);
+		leftModel.clear();
+	} //}}}
+
+	//{{{ Inner classes
+
+	//{{{ MyListModel class
+	private static class MyListModel<E> extends AbstractListModel implements Iterable<E>
+	{
+		private List<E> data;
+
+		private MyListModel(List<E> data)
+		{
+			this.data = data;
+		}
+
+		@Override
+		public int getSize()
+		{
+			return data.size();
+		}
+
+		@Override
+		public Object getElementAt(int index)
+		{
+			return data.get(index);
+		}
+
+		@Override
+		public Iterator<E> iterator()
+		{
+			return data.iterator();
+		}
+
+		public void clear()
+		{
+			if (data.isEmpty())
+				return;
+			int i = data.size();
+			data.clear();
+			fireIntervalRemoved(this, 0, i - 1);
+		}
+
+		public void addAll(Collection<E> newData)
+		{
+			int i = data.size();
+			data.addAll(newData);
+			fireIntervalAdded(this, i, i + newData.size() - 1);
+		}
+
+		public void remove(int index)
+		{
+			data.remove(index);
+
+			fireContentsChanged(this, index, index);
+		}
+
+		public void add(int pos, E[] addedDatas)
+		{
+			for (int i = addedDatas.length - 1; i >= 0; i--)
+				data.add(pos, addedDatas[i]);
+
+			fireContentsChanged(this, pos, pos + addedDatas.length - 1);
+		}
+	} //}}}
+
+	//{{{ MyTransferHandler class
+	private class MyTransferHandler extends TransferHandler
+	{
+		private JList sourceList;
+		private int[]indices;
+
+		@Override
+		public int getSourceActions(JComponent c)
+		{
+			return MOVE;
+		}
+
+		@Override
+		public boolean importData(JComponent comp, Transferable t)
+		{
+			try
+			{
+				@SuppressWarnings({"unchecked"})
+				E[] transferData = (E[]) t.getTransferData(MyTransferable.javaListFlavor);
+				JList targetList = (JList) comp;
+				@SuppressWarnings({"unchecked"})
+				MyListModel<E> targetModel = (MyListModel<E>) targetList.getModel();
+				@SuppressWarnings({"unchecked"})
+				MyListModel<E> sourceModel = (MyListModel<E>) sourceList.getModel();
+				int dropLocation = targetList.getSelectedIndex();
+				if(dropLocation == -1)dropLocation=0;
+				targetModel.add(dropLocation, transferData);
+				int dropStart = dropLocation;
+				if (targetList == sourceList)
+				{
+					// we are moving inside the same list
+					for (int i = indices.length - 1; i >= 0; i--)
+					{
+						int index = indices[i];
+						if (indices[i] >= dropLocation)
+						{
+							index += transferData.length;
+						}
+						else
+						{
+							dropStart--;
+						}
+						sourceModel.remove(index);
+					}
+					for (int i = indices.length - 1; i >= 0; i--)
+					{
+						indices[i] = dropStart + i;
+					}
+				}
+				else
+				{
+					// we are moving to another list
+					sourceList.clearSelection();
+					for (int i = indices.length - 1; i >= 0; i--)
+					{
+						sourceModel.remove(indices[i]);
+						indices[i] = dropLocation + i;
+					}
+				}
+				targetList.setSelectedIndices(indices);
+				return true;
+			}
+			catch (UnsupportedFlavorException e)
+			{
+				Log.log(Log.ERROR, this, e);
+			}
+			catch (IOException e)
+			{
+				Log.log(Log.ERROR, this, e);
+			}
+			return false;
+		}
+
+		@Override
+		protected Transferable createTransferable(JComponent c)
+		{
+			sourceList = (JList) c;
+			indices = sourceList.getSelectedIndices();
+
+			@SuppressWarnings("unchecked")
+			E[] objects = (E[]) sourceList.getSelectedValues();
+			return new MyTransferable<E>(objects);
+		}
+
+		@Override
+		public boolean canImport(JComponent comp, DataFlavor[] transferFlavors)
+		{
+			return comp == left || comp == right;
+		}
+	} //}}}
+
+	//{{{ MyTransferable class
+	private static class MyTransferable<E> implements Transferable
+	{
+		public static final DataFlavor javaListFlavor = new DataFlavor(Collection.class, "java.util.Collection");
+
+		private final E[] data;
+
+		private MyTransferable(E[] data)
+		{
+			this.data = data;
+		}
+
+		@Override
+		public DataFlavor[] getTransferDataFlavors()
+		{
+			return new DataFlavor[]{javaListFlavor};
+		}
+
+		@Override
+		public boolean isDataFlavorSupported(DataFlavor flavor)
+		{
+			return flavor.equals(javaListFlavor);
+		}
+
+		@Override
+		public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
+		{
+			return data;
+		}
+	} //}}}
+
+	//{{{ ActionHandler class
+	private class ActionHandler implements ActionListener
+	{
+		@Override
+		public void actionPerformed(ActionEvent ae)
+		{
+			Object source = ae.getSource();
+			if (source == selectAllButton)
+			{
+				moveAllToRight();
+				selectAllButton.setEnabled(false);
+				selectNoneButton.setEnabled(true);
+			}
+			else if (source == selectNoneButton)
+			{
+				moveAllToLeft();
+				selectAllButton.setEnabled(true);
+				selectNoneButton.setEnabled(false);
+			}
+		}
+	} //}}}
+
+	private class MyListDataListener implements ListDataListener
+	{
+		@Override
+		public void intervalAdded(ListDataEvent e)
+		{
+			dataUpdated(e);
+		}
+
+		@Override
+		public void intervalRemoved(ListDataEvent e)
+		{
+			dataUpdated(e);
+		}
+
+		@Override
+		public void contentsChanged(ListDataEvent e)
+		{
+			dataUpdated(e);
+		}
+		
+		private void dataUpdated(ListDataEvent e)
+		{
+			selectAllButton.setEnabled(getLeftSize() != 0);
+			selectNoneButton.setEnabled(getRightSize() != 0);
+		}
+	}
+	//}}}
+}
diff --git a/org/gjt/sp/jedit/gui/RegisterViewer.java b/org/gjt/sp/jedit/gui/RegisterViewer.java
index 4542763..4c800f7 100644
--- a/org/gjt/sp/jedit/gui/RegisterViewer.java
+++ b/org/gjt/sp/jedit/gui/RegisterViewer.java
@@ -1,6 +1,6 @@
 /*
  * RegisterViewer.java - Dockable view of register contents
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2004, 2005 Nicholas O'Leary
@@ -32,8 +32,8 @@ import org.gjt.sp.jedit.*;
 import org.gjt.sp.jedit.EditBus.EBHandler;
 import org.gjt.sp.jedit.Registers.Register;
 import org.gjt.sp.jedit.msg.RegisterChanged;
-import org.gjt.sp.jedit.msg.PropertiesChanged;
 //}}}
+
 /** Dockable view of register contents */
 public class RegisterViewer extends JPanel
 	implements DockableWindow, DefaultFocusComponent
@@ -153,6 +153,12 @@ public class RegisterViewer extends JPanel
 	//{{{ Private members
 
 	//{{{ Instance variables
+	/** contains either a
+	 *  - String object (no Register is registered yet,
+	 *                   "view-registers.none") or
+	 *  - Character objects ("name" of the register; char value must be between 0 and 255,
+	 *                       see Registers.java)
+	 */
 	private JList registerList;
 	private JTextArea contentTextArea;
 	private DocumentHandler documentHandler;
@@ -413,7 +419,7 @@ public class RegisterViewer extends JPanel
 		{
 			view.getTextArea().requestFocus();
 			view.toFront();
-	  	}
+		}
 	}//}}}
 
 	//{{{ TabHandler Class
@@ -422,7 +428,7 @@ public class RegisterViewer extends JPanel
 		public void actionPerformed(ActionEvent e)
 		{
 			registerList.requestFocusInWindow();
-	  	}
+		}
 	}//}}}
 
 	//{{{ InsertHandler Class
@@ -431,7 +437,7 @@ public class RegisterViewer extends JPanel
 		public void actionPerformed(ActionEvent e)
 		{
 			insertRegister();
-	  	}
+		}
 	}//}}}
 
 	//{{{ ClearHandler Class
@@ -441,6 +447,6 @@ public class RegisterViewer extends JPanel
 		{
 			clearSelectedIndex();
 
-	  	}
+		}
 	}//}}}
 }
diff --git a/org/gjt/sp/jedit/gui/RolloverButton.java b/org/gjt/sp/jedit/gui/RolloverButton.java
index fa53334..ef90529 100644
--- a/org/gjt/sp/jedit/gui/RolloverButton.java
+++ b/org/gjt/sp/jedit/gui/RolloverButton.java
@@ -1,6 +1,6 @@
 /*
  * RolloverButton.java - Class for buttons that implement rollovers
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Kris Kopicki
@@ -44,7 +44,7 @@ import org.gjt.sp.jedit.OperatingSystem;
  *
  * Note: You should not call <code>setBorder()</code> on your buttons,
  * as they probably won't work properly.
- * @version $Id: RolloverButton.java 21506 2012-03-29 17:58:53Z ezust $
+ * @version $Id: RolloverButton.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class RolloverButton extends JButton
 {
diff --git a/org/gjt/sp/jedit/gui/SelectLineRange.java b/org/gjt/sp/jedit/gui/SelectLineRange.java
index bc289b5..c3573f2 100644
--- a/org/gjt/sp/jedit/gui/SelectLineRange.java
+++ b/org/gjt/sp/jedit/gui/SelectLineRange.java
@@ -1,6 +1,6 @@
 /*
  * SelectLineRange.java - Selects a range of lines
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2000 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/ShortcutPrefixActiveEvent.java b/org/gjt/sp/jedit/gui/ShortcutPrefixActiveEvent.java
index b9ee7bb..26ce77d 100644
--- a/org/gjt/sp/jedit/gui/ShortcutPrefixActiveEvent.java
+++ b/org/gjt/sp/jedit/gui/ShortcutPrefixActiveEvent.java
@@ -1,7 +1,7 @@
 /*
  *  ShortcutPrefixActiveEvent.java - Event fired when jEdit starts and stops
  *  listening for shortcut completions
- *  :tabSize=8:indentSize=8:noTabs=false:
+ *  :tabSize=4:indentSize=4:noTabs=false:
  *  :folding=explicit:collapseFolds=1:
  *
  *  Copyright (C) 2005 Jeffrey Hoyt
diff --git a/org/gjt/sp/jedit/gui/StatusBar.java b/org/gjt/sp/jedit/gui/StatusBar.java
index 9e5e36e..3f309b2 100644
--- a/org/gjt/sp/jedit/gui/StatusBar.java
+++ b/org/gjt/sp/jedit/gui/StatusBar.java
@@ -1,6 +1,6 @@
 /*
  * StatusBar.java - The status bar displayed at the bottom of views
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2004 Slava Pestov
@@ -52,11 +52,11 @@ import org.gjt.sp.util.*;
  * <li>Displaying memory status
  * </ul>
  *
- * @version $Id: StatusBar.java 21616 2012-04-30 08:32:24Z kpouer $
+ * @version $Id: StatusBar.java 22942 2013-04-22 11:27:52Z thomasmey $
  * @author Slava Pestov
  * @since jEdit 3.2pre2
  */
-public class StatusBar extends JPanel implements WorkThreadProgressListener
+public class StatusBar extends JPanel
 {
 	//{{{ StatusBar constructor
 	public StatusBar(View view)
@@ -93,6 +93,8 @@ public class StatusBar extends JPanel implements WorkThreadProgressListener
 		rectSelectWidget = _getWidget("rectSelect");
 		overwriteWidget = _getWidget("overwrite");
 		lineSepWidget = _getWidget("lineSep");
+
+		taskHandler = new TaskHandler();
 	} //}}}
 
 	//{{{ propertiesChanged() method
@@ -174,7 +176,7 @@ public class StatusBar extends JPanel implements WorkThreadProgressListener
 	public void addNotify()
 	{
 		super.addNotify();
-		VFSManager.getIOThreadPool().addProgressListener(this);
+		TaskManager.instance.addTaskListener(taskHandler);
 	} //}}}
 
 	//{{{ removeNotify() method
@@ -182,24 +184,21 @@ public class StatusBar extends JPanel implements WorkThreadProgressListener
 	public void removeNotify()
 	{
 		super.removeNotify();
-		VFSManager.getIOThreadPool().removeProgressListener(this);
+		TaskManager.instance.removeTaskListener(taskHandler);
 	} //}}}
 
-	//{{{ WorkThreadListener implementation
-
-	//{{{ statusUpdate() method
-	public void statusUpdate(final WorkThreadPool threadPool, int threadIndex)
+	//{{{ TaskListener implementation
+	private class TaskHandler implements TaskListener
 	{
-		SwingUtilities.invokeLater(new Runnable()
+		private final Runnable statusLineIo = new Runnable()
 		{
 			public void run()
 			{
 				// don't obscure existing message
-				if(message != null && !"".equals(message.getText().trim())
-					&& !currentMessageIsIO)
+				if(!currentMessageIsIO && message != null && !"".equals(message.getText().trim()))
 					return;
 
-				int requestCount = threadPool.getRequestCount();
+				int requestCount = TaskManager.instance.countIoTasks();
 				if(requestCount == 0)
 				{
 					setMessageAndClear(jEdit.getProperty(
@@ -220,12 +219,39 @@ public class StatusBar extends JPanel implements WorkThreadProgressListener
 					currentMessageIsIO = true;
 				}
 			}
-		});
-	} //}}}
+		};
 
-	//{{{ progressUpdate() method
-	public void progressUpdate(WorkThreadPool threadPool, int threadIndex)
-	{
+		//{{{ waiting() method
+		public void waiting(Task task)
+		{
+			SwingUtilities.invokeLater(statusLineIo);
+		} //}}}
+	
+		//{{{ running() method
+		public void running(Task task)
+		{
+		} //}}}
+	
+		//{{{ done() method
+		public void done(Task task)
+		{
+			SwingUtilities.invokeLater(statusLineIo);
+		} //}}}
+	
+		//{{{ statusUpdate() method
+		public void statusUpdated(Task task)
+		{
+		} //}}}
+
+		//{{{ maximumUpdated() method
+		public void maximumUpdated(Task task)
+		{
+		} //}}}
+
+		//{{{ valueUpdated() method
+		public void valueUpdated(Task task)
+		{
+		} //}}}
 	} //}}}
 
 	//}}}
@@ -417,6 +443,7 @@ public class StatusBar extends JPanel implements WorkThreadProgressListener
 
 	//{{{ Private members
 	private String currentBar;
+	private final TaskHandler taskHandler;
 	private final View view;
 	private final JPanel panel;
 	private final Box box;
diff --git a/org/gjt/sp/jedit/gui/StyleEditor.java b/org/gjt/sp/jedit/gui/StyleEditor.java
index fbf1eb3..e2db00d 100644
--- a/org/gjt/sp/jedit/gui/StyleEditor.java
+++ b/org/gjt/sp/jedit/gui/StyleEditor.java
@@ -1,6 +1,6 @@
 /*
  * StyleEditor.java - Style editor dialog
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2000, 2001 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/TaskMonitor.java b/org/gjt/sp/jedit/gui/TaskMonitor.java
index 126af19..92c8fa6 100644
--- a/org/gjt/sp/jedit/gui/TaskMonitor.java
+++ b/org/gjt/sp/jedit/gui/TaskMonitor.java
@@ -1,6 +1,6 @@
 /*
  * TaskMonitor
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright © 2010-2012 Matthieu Casanova
@@ -81,7 +81,6 @@ public class TaskMonitor extends JPanel implements TaskListener
 		panel.add(scroll);
 		updateTasksCount();
 
-		add(new IOProgressMonitor(), BorderLayout.NORTH);
 		add(panel);
 	} //}}}
 
diff --git a/org/gjt/sp/jedit/gui/TextAreaDialog.java b/org/gjt/sp/jedit/gui/TextAreaDialog.java
index e7f5cac..7885a56 100644
--- a/org/gjt/sp/jedit/gui/TextAreaDialog.java
+++ b/org/gjt/sp/jedit/gui/TextAreaDialog.java
@@ -1,6 +1,6 @@
 /*
  * TextAreaDialog.java - A dialog box with a text area
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/TipOfTheDay.java b/org/gjt/sp/jedit/gui/TipOfTheDay.java
index c50c749..e2a8fdc 100644
--- a/org/gjt/sp/jedit/gui/TipOfTheDay.java
+++ b/org/gjt/sp/jedit/gui/TipOfTheDay.java
@@ -1,6 +1,6 @@
 /*
  * TipOfTheDay.java - Tip of the day window
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2001, 2002 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/ToolBarManager.java b/org/gjt/sp/jedit/gui/ToolBarManager.java
index f9dd4d5..03b02a3 100644
--- a/org/gjt/sp/jedit/gui/ToolBarManager.java
+++ b/org/gjt/sp/jedit/gui/ToolBarManager.java
@@ -1,6 +1,6 @@
 /*
  * ToolBarManager.java - Handles tool bars for the View
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 mike dillon
diff --git a/org/gjt/sp/jedit/gui/VariableGridLayout.java b/org/gjt/sp/jedit/gui/VariableGridLayout.java
index 6bc687b..21646d9 100644
--- a/org/gjt/sp/jedit/gui/VariableGridLayout.java
+++ b/org/gjt/sp/jedit/gui/VariableGridLayout.java
@@ -1,6 +1,6 @@
 /*
  * VariableGridLayout.java - a grid layout manager with variable cell sizes
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  *
  * Originally written by Dirk Moebius for the jEdit project. This work has been
  * placed into the public domain. You may use this work in any way and for any
diff --git a/org/gjt/sp/jedit/gui/statusbar/BufferSetWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/BufferSetWidgetFactory.java
index eb7d013..61f391b 100644
--- a/org/gjt/sp/jedit/gui/statusbar/BufferSetWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/BufferSetWidgetFactory.java
@@ -1,6 +1,6 @@
 /*
  * BufferSetWidgetFactory.java - The bufferSet widget service
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008, 2009 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/statusbar/ClockWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/ClockWidgetFactory.java
index 50c4e4d..2f2aceb 100644
--- a/org/gjt/sp/jedit/gui/statusbar/ClockWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/ClockWidgetFactory.java
@@ -1,6 +1,6 @@
 /*
  * ClockWidgetFactory.java - The clock widget service
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/statusbar/EncodingWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/EncodingWidgetFactory.java
index 74d8a4a..37f81f0 100644
--- a/org/gjt/sp/jedit/gui/statusbar/EncodingWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/EncodingWidgetFactory.java
@@ -1,6 +1,6 @@
 /*
  * EncodingWidgetFactory.java - The encoding widget service
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/statusbar/ErrorsWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/ErrorsWidgetFactory.java
index 0ead86e..0571ab7 100644
--- a/org/gjt/sp/jedit/gui/statusbar/ErrorsWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/ErrorsWidgetFactory.java
@@ -1,6 +1,6 @@
 /*
  * ErrorsWidgetFactory.java - The error widget service
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008-2011 Matthieu Casanova
@@ -23,6 +23,8 @@
 package org.gjt.sp.jedit.gui.statusbar;
 
 //{{{ Imports
+import org.gjt.sp.jedit.EditAction;
+import org.gjt.sp.jedit.Registers;
 import org.gjt.sp.jedit.View;
 import org.gjt.sp.jedit.jEdit;
 import org.gjt.sp.jedit.GUIUtilities;
@@ -210,6 +212,21 @@ public class ErrorsWidgetFactory implements StatusWidgetFactory
 			printStream = new PrintStream(byteArrayOutputStream);
 			throwables = Log.throwables.toArray();
 			textArea = new JEditEmbeddedTextArea();
+
+			JPopupMenu menu = new JPopupMenu();
+			JMenuItem copy = new JMenuItem(jEdit.getProperty("copy.label").replace("$",""));
+			copy.addActionListener(new ActionListener()
+			{
+				@Override
+				public void actionPerformed(ActionEvent e)
+				{
+					Registers.copy(textArea, '$');
+				}
+			});
+			menu.add(copy);
+			textArea.setRightClickPopup(menu);
+			textArea.setRightClickPopupEnabled(true);
+
 			textArea.getBuffer().setMode(jEdit.getMode("logs"));
 			if (throwables.length != 0)
 			{
@@ -233,7 +250,7 @@ public class ErrorsWidgetFactory implements StatusWidgetFactory
 			Box buttons = new Box(BoxLayout.X_AXIS);
 			buttons.add(Box.createGlue());
 
-			buttons.add(removeThisError = new JButton(jEdit.getProperty("grab-key.remove")));
+			buttons.add(removeThisError = new JButton(jEdit.getProperty("common.removeCurrent")));
 			buttons.add(Box.createHorizontalStrut(6));
 			buttons.add(removeAllErrors = new JButton(jEdit.getProperty("common.clearAll")));
 
diff --git a/org/gjt/sp/jedit/gui/statusbar/FoldWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/FoldWidgetFactory.java
index 6558ce1..ced7c51 100644
--- a/org/gjt/sp/jedit/gui/statusbar/FoldWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/FoldWidgetFactory.java
@@ -1,6 +1,6 @@
 /*
  * FoldWidgetFactory.java - The fold widget service
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/statusbar/IndentWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/IndentWidgetFactory.java
index 5c81880..47e0156 100644
--- a/org/gjt/sp/jedit/gui/statusbar/IndentWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/IndentWidgetFactory.java
@@ -1,6 +1,6 @@
 /*
  * IndentWidgetFactory.java - The indent widget service
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2011 Evan Wright
diff --git a/org/gjt/sp/jedit/gui/statusbar/LastModifiedWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/LastModifiedWidgetFactory.java
index 9705448..e9452a1 100644
--- a/org/gjt/sp/jedit/gui/statusbar/LastModifiedWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/LastModifiedWidgetFactory.java
@@ -1,156 +1,156 @@
-/*
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.gui.statusbar;
-
-//{{{ Imports
-import org.gjt.sp.jedit.*;
-import org.gjt.sp.jedit.io.VFS;
-import org.gjt.sp.jedit.io.VFSFile;
-import org.gjt.sp.jedit.io.VFSManager;
-import org.gjt.sp.jedit.msg.BufferUpdate;
-import org.gjt.sp.jedit.msg.EditPaneUpdate;
-import org.gjt.sp.util.Log;
-
-import javax.swing.*;
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-//}}}
-
-/**
- * A Statusbar widget that show the time of last save of the current buffer.
- *
- * @author Matthieu Casanova
- * @since jEdit 4.5pre1
- */
-public class LastModifiedWidgetFactory implements StatusWidgetFactory
-{
-	//{{{ getWidget() method
-	public Widget getWidget(View view)
-	{
-		Widget lastModifiedWidget = new LastModifiedWidget(view);
-		return lastModifiedWidget;
-	} //}}}
-
-	//{{{ BufferSetWidget class
-	public static class LastModifiedWidget implements Widget
-	{
-		private final JLabel lastModifiedLabel;
-		private final View view;
-		private static final SimpleDateFormat sdf = new SimpleDateFormat();
-		private static final Date date = new Date();
-
-
-		LastModifiedWidget(View view)
-		{
-			this.view = view;
-			lastModifiedLabel = new JLabel()
-			{
-				@Override
-				public void addNotify()
-				{
-					super.addNotify();
-					LastModifiedWidget.this.update();
-					EditBus.addToBus(LastModifiedWidget.this);
-				}
-
-				@Override
-				public void removeNotify()
-				{
-					super.removeNotify();
-					EditBus.removeFromBus(LastModifiedWidget.this);
-				}
-			};
-			lastModifiedLabel.setToolTipText(jEdit.getProperty("fileprop.lastmod"));
-			update();
-		}
-
-		//{{{ getComponent() method
-		public JComponent getComponent()
-		{
-			return lastModifiedLabel;
-		} //}}}
-
-		//{{{ update() method
-		public void update()
-		{
-			Buffer buffer = view.getBuffer();
-			String path = buffer.getPath();
-			VFS vfs = VFSManager.getVFSForPath(path);
-			Object session = vfs.createVFSSession(path, view);
-			try
-			{
-				VFSFile file = vfs._getFile(session, path, view);
-				if (file == null)
-				{
-					lastModifiedLabel.setText("");
-				}
-				else
-				{
-					lastModifiedLabel.setText(file.getExtendedAttribute(VFS.EA_MODIFIED));
-				}
-			}
-			catch (IOException e)
-			{
-				Log.log(Log.ERROR, this, e);
-			}
-			finally
-			{
-				try
-				{
-					vfs._endVFSSession(session, view);
-				}
-				catch (IOException e)
-				{
-				}
-			}
-		} //}}}
-
-		//{{{ propertiesChanged() methods
-		@Override
-		public void propertiesChanged()
-		{
-
-		} //}}}
-
-		//{{{ handleMessage() methods
-		@EditBus.EBHandler
-		public void handleMessage(EditPaneUpdate message)
-		{
-			if (message.getWhat() == EditPaneUpdate.BUFFER_CHANGED &&
-				message.getEditPane().getView() == view)
-			{
-				update();
-			}
-		}
-
-		@EditBus.EBHandler
-		public void handleMessage(BufferUpdate message)
-		{
-			if (message.getBuffer() == view.getBuffer())
-			{
-				update();
-			}
-		} //}}}
-
-	} //}}}
-
+/*
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.gui.statusbar;
+
+//{{{ Imports
+import org.gjt.sp.jedit.*;
+import org.gjt.sp.jedit.io.VFS;
+import org.gjt.sp.jedit.io.VFSFile;
+import org.gjt.sp.jedit.io.VFSManager;
+import org.gjt.sp.jedit.msg.BufferUpdate;
+import org.gjt.sp.jedit.msg.EditPaneUpdate;
+import org.gjt.sp.util.Log;
+
+import javax.swing.*;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+//}}}
+
+/**
+ * A Statusbar widget that show the time of last save of the current buffer.
+ *
+ * @author Matthieu Casanova
+ * @since jEdit 4.5pre1
+ */
+public class LastModifiedWidgetFactory implements StatusWidgetFactory
+{
+	//{{{ getWidget() method
+	public Widget getWidget(View view)
+	{
+		Widget lastModifiedWidget = new LastModifiedWidget(view);
+		return lastModifiedWidget;
+	} //}}}
+
+	//{{{ BufferSetWidget class
+	public static class LastModifiedWidget implements Widget
+	{
+		private final JLabel lastModifiedLabel;
+		private final View view;
+		private static final SimpleDateFormat sdf = new SimpleDateFormat();
+		private static final Date date = new Date();
+
+
+		LastModifiedWidget(View view)
+		{
+			this.view = view;
+			lastModifiedLabel = new JLabel()
+			{
+				@Override
+				public void addNotify()
+				{
+					super.addNotify();
+					LastModifiedWidget.this.update();
+					EditBus.addToBus(LastModifiedWidget.this);
+				}
+
+				@Override
+				public void removeNotify()
+				{
+					super.removeNotify();
+					EditBus.removeFromBus(LastModifiedWidget.this);
+				}
+			};
+			lastModifiedLabel.setToolTipText(jEdit.getProperty("fileprop.lastmod"));
+			update();
+		}
+
+		//{{{ getComponent() method
+		public JComponent getComponent()
+		{
+			return lastModifiedLabel;
+		} //}}}
+
+		//{{{ update() method
+		public void update()
+		{
+			Buffer buffer = view.getBuffer();
+			String path = buffer.getPath();
+			VFS vfs = VFSManager.getVFSForPath(path);
+			Object session = vfs.createVFSSession(path, view);
+			try
+			{
+				VFSFile file = vfs._getFile(session, path, view);
+				if (file == null)
+				{
+					lastModifiedLabel.setText("");
+				}
+				else
+				{
+					lastModifiedLabel.setText(file.getExtendedAttribute(VFS.EA_MODIFIED));
+				}
+			}
+			catch (IOException e)
+			{
+				Log.log(Log.ERROR, this, e);
+			}
+			finally
+			{
+				try
+				{
+					vfs._endVFSSession(session, view);
+				}
+				catch (IOException e)
+				{
+				}
+			}
+		} //}}}
+
+		//{{{ propertiesChanged() methods
+		@Override
+		public void propertiesChanged()
+		{
+
+		} //}}}
+
+		//{{{ handleMessage() methods
+		@EditBus.EBHandler
+		public void handleMessage(EditPaneUpdate message)
+		{
+			if (message.getWhat() == EditPaneUpdate.BUFFER_CHANGED &&
+				message.getEditPane().getView() == view)
+			{
+				update();
+			}
+		}
+
+		@EditBus.EBHandler
+		public void handleMessage(BufferUpdate message)
+		{
+			if (message.getBuffer() == view.getBuffer())
+			{
+				update();
+			}
+		} //}}}
+
+	} //}}}
+
 }
\ No newline at end of file
diff --git a/org/gjt/sp/jedit/gui/statusbar/LineSepWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/LineSepWidgetFactory.java
index 3688e01..c33756a 100644
--- a/org/gjt/sp/jedit/gui/statusbar/LineSepWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/LineSepWidgetFactory.java
@@ -1,6 +1,6 @@
 /*
  * LineSepWidgetFactory.java - The line separator widget service
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/statusbar/ModeWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/ModeWidgetFactory.java
index 7730c2b..68bc184 100644
--- a/org/gjt/sp/jedit/gui/statusbar/ModeWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/ModeWidgetFactory.java
@@ -1,6 +1,6 @@
 /*
  * ModeWidgetFactory.java - The mode widget service
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/statusbar/MultiSelectWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/MultiSelectWidgetFactory.java
index 95e24d4..70e8182 100644
--- a/org/gjt/sp/jedit/gui/statusbar/MultiSelectWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/MultiSelectWidgetFactory.java
@@ -1,6 +1,6 @@
 /*
  * MultiSelectWidgetFactory.java - The clock widget service
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/statusbar/OverwriteWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/OverwriteWidgetFactory.java
index 02967d3..c96cb04 100644
--- a/org/gjt/sp/jedit/gui/statusbar/OverwriteWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/OverwriteWidgetFactory.java
@@ -1,6 +1,6 @@
 /*
  * OverwriteWidgetFactory.java - The overwrite widget service
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/statusbar/RectSelectWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/RectSelectWidgetFactory.java
index d157c4a..6c25581 100644
--- a/org/gjt/sp/jedit/gui/statusbar/RectSelectWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/RectSelectWidgetFactory.java
@@ -1,6 +1,6 @@
 /*
  * RectSelectWidgetFactory.java - The rectangular selection widget service
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/statusbar/SelectionLengthWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/SelectionLengthWidgetFactory.java
index 50261dd..c790c85 100644
--- a/org/gjt/sp/jedit/gui/statusbar/SelectionLengthWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/SelectionLengthWidgetFactory.java
@@ -1,7 +1,7 @@
 /*
  * SelectionLengthWidgetFactory.java - A status bar widget that displays
  * the length of the selection at caret
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/statusbar/StatusWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/StatusWidgetFactory.java
index 0175c85..fd5f504 100644
--- a/org/gjt/sp/jedit/gui/statusbar/StatusWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/StatusWidgetFactory.java
@@ -1,6 +1,6 @@
 /*
  * StatusWidgetFactory.java - The service for widget of the status bar
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/statusbar/TaskMonitorWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/TaskMonitorWidgetFactory.java
index 504bb5d..9deb849 100644
--- a/org/gjt/sp/jedit/gui/statusbar/TaskMonitorWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/TaskMonitorWidgetFactory.java
@@ -1,147 +1,146 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.gui.statusbar;
-
-//{{{ Imports
-import org.gjt.sp.jedit.*;
-import org.gjt.sp.jedit.gui.DockableWindowManager;
-import org.gjt.sp.util.Task;
-import org.gjt.sp.util.TaskListener;
-import org.gjt.sp.util.TaskManager;
-
-import javax.swing.*;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-//}}}
-
-/**
- * A Statusbar widget that monitor the task manager.
- *
- * @author Matthieu Casanova
- * @since jEdit 4.5pre1
- */
-public class TaskMonitorWidgetFactory implements StatusWidgetFactory
-{
-	//{{{ getWidget() method
-	@Override
-    public Widget getWidget(View view)
-	{
-		Widget widget = new TaskMonitorWidget(view);
-		widget.getComponent().setToolTipText(jEdit.getProperty("statusbar.task-monitor.tooltip"));
-		return widget;
-	} //}}}
-
-    //{{{ TaskMonitorWidget class
-    private static class TaskMonitorWidget extends JLabel implements Widget, TaskListener
-    {
-        private TaskMonitorWidget(final View view)
-        {
-            addMouseListener(new MouseAdapter()
-            {
-                @Override
-                public void mouseClicked(MouseEvent e)
-                {
-                    if (SwingUtilities.isLeftMouseButton(e))
-                    {
-                        view.getDockableWindowManager().showDockableWindow("task-monitor");
-                    }
-                }
-            });
-        }
-
-        @Override
-        public void addNotify()
-        {
-            super.addNotify();
-            TaskManager.instance.addTaskListener(this);
-            update();
-        }
-
-        @Override
-        public void removeNotify()
-        {
-            super.removeNotify();
-            TaskManager.instance.removeTaskListener(this);
-        }
-
-        @Override
-        public JComponent getComponent()
-        {
-            return this;
-        }
-
-        @Override
-        public void propertiesChanged()
-        {
-        }
-
-        @Override
-        public void update()
-        {
-            int count = TaskManager.instance.countTasks();
-            if (count == 0)
-            {
-                setText(null);
-            }
-            else
-            {
-                setText(jEdit.getProperty("statusbar.task-monitor.template", new Object[]{Integer.toString(count)}));
-            }
-        }
-
-        @Override
-        public void waiting(Task task)
-        {
-            update();
-        }
-
-        @Override
-        public void running(Task task)
-        {
-            update();
-        }
-
-        @Override
-        public void done(Task task)
-        {
-            update();
-        }
-
-        @Override
-        public void statusUpdated(Task task)
-        {
-            update();
-        }
-
-        @Override
-        public void maximumUpdated(Task task)
-        {
-            update();
-        }
-
-        @Override
-        public void valueUpdated(Task task)
-        {
-            update();
-        }
-	} //}}}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.gui.statusbar;
+
+//{{{ Imports
+import org.gjt.sp.jedit.*;
+import org.gjt.sp.util.Task;
+import org.gjt.sp.util.TaskListener;
+import org.gjt.sp.util.TaskManager;
+
+import javax.swing.*;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+//}}}
+
+/**
+ * A Statusbar widget that monitor the task manager.
+ *
+ * @author Matthieu Casanova
+ * @since jEdit 4.5pre1
+ */
+public class TaskMonitorWidgetFactory implements StatusWidgetFactory
+{
+	//{{{ getWidget() method
+	@Override
+    public Widget getWidget(View view)
+	{
+		Widget widget = new TaskMonitorWidget(view);
+		widget.getComponent().setToolTipText(jEdit.getProperty("statusbar.task-monitor.tooltip"));
+		return widget;
+	} //}}}
+
+    //{{{ TaskMonitorWidget class
+    private static class TaskMonitorWidget extends JLabel implements Widget, TaskListener
+    {
+        private TaskMonitorWidget(final View view)
+        {
+            addMouseListener(new MouseAdapter()
+            {
+                @Override
+                public void mouseClicked(MouseEvent e)
+                {
+                    if (SwingUtilities.isLeftMouseButton(e))
+                    {
+                        view.getDockableWindowManager().showDockableWindow("task-monitor");
+                    }
+                }
+            });
+        }
+
+        @Override
+        public void addNotify()
+        {
+            super.addNotify();
+            TaskManager.instance.addTaskListener(this);
+            update();
+        }
+
+        @Override
+        public void removeNotify()
+        {
+            super.removeNotify();
+            TaskManager.instance.removeTaskListener(this);
+        }
+
+        @Override
+        public JComponent getComponent()
+        {
+            return this;
+        }
+
+        @Override
+        public void propertiesChanged()
+        {
+        }
+
+        @Override
+        public void update()
+        {
+            int count = TaskManager.instance.countTasks();
+            if (count == 0)
+            {
+                setText(null);
+            }
+            else
+            {
+                setText(jEdit.getProperty("statusbar.task-monitor.template", new Object[]{Integer.toString(count)}));
+            }
+        }
+
+        @Override
+        public void waiting(Task task)
+        {
+            update();
+        }
+
+        @Override
+        public void running(Task task)
+        {
+            update();
+        }
+
+        @Override
+        public void done(Task task)
+        {
+            update();
+        }
+
+        @Override
+        public void statusUpdated(Task task)
+        {
+            update();
+        }
+
+        @Override
+        public void maximumUpdated(Task task)
+        {
+            update();
+        }
+
+        @Override
+        public void valueUpdated(Task task)
+        {
+            update();
+        }
+	} //}}}
 }
\ No newline at end of file
diff --git a/org/gjt/sp/jedit/gui/statusbar/ToolTipLabel.java b/org/gjt/sp/jedit/gui/statusbar/ToolTipLabel.java
index 08e1dbf..7788ba3 100644
--- a/org/gjt/sp/jedit/gui/statusbar/ToolTipLabel.java
+++ b/org/gjt/sp/jedit/gui/statusbar/ToolTipLabel.java
@@ -1,6 +1,6 @@
 /*
  * ToolTipLabel.java - a label that has his tooltip on the top 
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2004 Slava Pestov
diff --git a/org/gjt/sp/jedit/gui/statusbar/Widget.java b/org/gjt/sp/jedit/gui/statusbar/Widget.java
index d6fdf29..7ec84f2 100644
--- a/org/gjt/sp/jedit/gui/statusbar/Widget.java
+++ b/org/gjt/sp/jedit/gui/statusbar/Widget.java
@@ -1,6 +1,6 @@
 /*
  * Widget.java - The status bar widget interface
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/statusbar/WrapWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/WrapWidgetFactory.java
index 7e5613c..03c66c4 100644
--- a/org/gjt/sp/jedit/gui/statusbar/WrapWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/WrapWidgetFactory.java
@@ -1,6 +1,6 @@
 /*
  * WrapWidgetFactory.java - The wrap widget service
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/gui/tray/JEditSwingTrayIcon.java b/org/gjt/sp/jedit/gui/tray/JEditSwingTrayIcon.java
index f761278..294bedd 100644
--- a/org/gjt/sp/jedit/gui/tray/JEditSwingTrayIcon.java
+++ b/org/gjt/sp/jedit/gui/tray/JEditSwingTrayIcon.java
@@ -1,196 +1,196 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 jEdit contributors
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.gui.tray;
-
-//{{{ Imports
-import java.awt.Frame;
-import java.awt.Window;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.swing.JMenuItem;
-import javax.swing.JPopupMenu;
-
-import org.gjt.sp.jedit.EBComponent;
-import org.gjt.sp.jedit.EBMessage;
-import org.gjt.sp.jedit.EditServer;
-import org.gjt.sp.jedit.GUIUtilities;
-import org.gjt.sp.jedit.View;
-import org.gjt.sp.jedit.jEdit;
-import org.gjt.sp.jedit.msg.EditPaneUpdate;
-import org.gjt.sp.util.StringList;
-//}}}
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 4.5pre1
- */
-public class JEditSwingTrayIcon extends JEditTrayIcon implements EBComponent
-{
-	private boolean restore;
-	private String userDir;
-	private String[] args;
-
-	//{{{ JEditSwingTrayIcon() constructor
-	public JEditSwingTrayIcon()
-	{
-		super(GUIUtilities.getEditorIcon(), "jEdit");
-		setImageAutoSize(true);
-		JPopupMenu popup = new JPopupMenu();
-		JMenuItem newViewItem = new JMenuItem(jEdit.getProperty("tray.newView.label"));
-		JMenuItem newPlainViewItem = new JMenuItem(jEdit.getProperty("tray.newPlainView.label"));
-		JMenuItem exitItem = new JMenuItem(jEdit.getProperty("tray.exit.label"));
-
-		popup.add(newViewItem);
-		popup.add(newPlainViewItem);
-		popup.addSeparator();
-		popup.add(exitItem);
-		ActionListener actionListener = new MyActionListener(newViewItem, newPlainViewItem, exitItem);
-		newViewItem.addActionListener(actionListener);
-		newPlainViewItem.addActionListener(actionListener);
-		exitItem.addActionListener(actionListener);
-		setMenu(popup);
-		addMouseListener(new MyMouseAdapter());
-	} //}}}
-
-	
-	@Override
-	/** Update tooltip to reflect the window titles currently available. */
-	public void handleMessage(EBMessage message)
-	{
-		if (message instanceof EditPaneUpdate && 
-			(((EditPaneUpdate)message).getWhat() == EditPaneUpdate.BUFFER_CHANGED)) {
-			StringList sl = new StringList();
-			for (View v: jEdit.getViews()) 
-				sl.add(v.getTitle());					
-			setToolTip(sl.join(" | "));		
-		}
-	}
-	
-	
-	//{{{ setTrayIconArgs() method
-	@Override
-	void setTrayIconArgs(boolean restore, String userDir, String[] args)
-	{
-		this.restore = restore;
-		this.userDir = userDir;
-		this.args = args;
-	} //}}}
-
-	//{{{ MyMouseAdapter class
-	private class MyMouseAdapter extends MouseAdapter
-	{
-		private final Map<Window,Boolean> windowState = new HashMap<Window, Boolean>();
-
-		@Override
-		public void mouseClicked(MouseEvent e)
-		{
-			if (e.getButton() != MouseEvent.BUTTON1)
-				return;
-			if (jEdit.getViewCount() == 0)
-			{
-				EditServer.handleClient(restore, true, false, userDir, args);
-			}
-			else
-			{
-				boolean newVisibilityState = !jEdit.getActiveView().isVisible();
-				if (newVisibilityState)
-				{
-					for (Window window : Window.getOwnerlessWindows())
-					{
-						if (skipWindow(window))
-							continue;
-						Boolean previousState = windowState.get(window);
-						if (previousState == null)
-							window.setVisible(true);
-						else if (previousState)
-							window.setVisible(previousState);
-					}
-					windowState.clear();
-					if (jEdit.getActiveView().getState() == Frame.ICONIFIED)
-						jEdit.getActiveView().setState(Frame.NORMAL);
-					jEdit.getActiveView().toFront();
-				}
-				else
-				{
-					for (Window window : Window.getOwnerlessWindows())
-					{
-						if (skipWindow(window))
-							continue;
-						windowState.put(window, window.isVisible());
-						window.setVisible(false);
-					}
-				}
-			}
-		}
-
-		//{{{ skipWindow method
-		/**
-		 * Check if a window is not top level or systray icon
-		 * @param window the checked window
-		 * @return true if it is not toplevel or systray icon
-		 */
-		private boolean skipWindow(Window window)
-		{
-			if (window.getClass().getName().contains("Tray"))
-				return true;
-			return false;
-		} //}}}
-
-	} //}}}
-
-	
-	
-	//{{{ MyActionListener class
-	private static class MyActionListener implements ActionListener
-	{
-		private final JMenuItem newViewItem;
-		private final JMenuItem newPlainViewItem;
-		private final JMenuItem exitItem;
-
-		MyActionListener(JMenuItem newViewItem, JMenuItem newPlainViewItem, JMenuItem exitItem)
-		{
-			this.newViewItem = newViewItem;
-			this.newPlainViewItem = newPlainViewItem;
-			this.exitItem = exitItem;
-		}
-
-		@Override
-		public void actionPerformed(ActionEvent e)
-		{
-			if (e.getSource() == newViewItem)
-			{
-				jEdit.newView(null);
-			} else if (e.getSource() == newPlainViewItem)
-			{
-				jEdit.newView(null, null, true);
-			} else if (e.getSource() == exitItem)
-			{
-				jEdit.exit(null, true);
-			}
-		}
-	} //}}}
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 jEdit contributors
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.gui.tray;
+
+//{{{ Imports
+import java.awt.Frame;
+import java.awt.Window;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+
+import org.gjt.sp.jedit.EBComponent;
+import org.gjt.sp.jedit.EBMessage;
+import org.gjt.sp.jedit.EditServer;
+import org.gjt.sp.jedit.GUIUtilities;
+import org.gjt.sp.jedit.View;
+import org.gjt.sp.jedit.jEdit;
+import org.gjt.sp.jedit.msg.EditPaneUpdate;
+import org.gjt.sp.util.StringList;
+//}}}
+
+/**
+ * @author Matthieu Casanova
+ * @since jEdit 4.5pre1
+ */
+public class JEditSwingTrayIcon extends JEditTrayIcon implements EBComponent
+{
+	private boolean restore;
+	private String userDir;
+	private String[] args;
+
+	//{{{ JEditSwingTrayIcon() constructor
+	public JEditSwingTrayIcon()
+	{
+		super(GUIUtilities.getEditorIcon(), "jEdit");
+		setImageAutoSize(true);
+		JPopupMenu popup = new JPopupMenu();
+		JMenuItem newViewItem = new JMenuItem(jEdit.getProperty("tray.newView.label"));
+		JMenuItem newPlainViewItem = new JMenuItem(jEdit.getProperty("tray.newPlainView.label"));
+		JMenuItem exitItem = new JMenuItem(jEdit.getProperty("tray.exit.label"));
+
+		popup.add(newViewItem);
+		popup.add(newPlainViewItem);
+		popup.addSeparator();
+		popup.add(exitItem);
+		ActionListener actionListener = new MyActionListener(newViewItem, newPlainViewItem, exitItem);
+		newViewItem.addActionListener(actionListener);
+		newPlainViewItem.addActionListener(actionListener);
+		exitItem.addActionListener(actionListener);
+		setMenu(popup);
+		addMouseListener(new MyMouseAdapter());
+	} //}}}
+
+	
+	@Override
+	/** Update tooltip to reflect the window titles currently available. */
+	public void handleMessage(EBMessage message)
+	{
+		if (message instanceof EditPaneUpdate && 
+			(((EditPaneUpdate)message).getWhat() == EditPaneUpdate.BUFFER_CHANGED)) {
+			StringList sl = new StringList();
+			for (View v: jEdit.getViews()) 
+				sl.add(v.getTitle());					
+			setToolTip(sl.join(" | "));		
+		}
+	}
+	
+	
+	//{{{ setTrayIconArgs() method
+	@Override
+	void setTrayIconArgs(boolean restore, String userDir, String[] args)
+	{
+		this.restore = restore;
+		this.userDir = userDir;
+		this.args = args;
+	} //}}}
+
+	//{{{ MyMouseAdapter class
+	private class MyMouseAdapter extends MouseAdapter
+	{
+		private final Map<Window,Boolean> windowState = new HashMap<Window, Boolean>();
+
+		@Override
+		public void mouseClicked(MouseEvent e)
+		{
+			if (e.getButton() != MouseEvent.BUTTON1)
+				return;
+			if (jEdit.getViewCount() == 0)
+			{
+				EditServer.handleClient(restore, true, false, userDir, args);
+			}
+			else
+			{
+				boolean newVisibilityState = !jEdit.getActiveView().isVisible();
+				if (newVisibilityState)
+				{
+					for (Window window : Window.getOwnerlessWindows())
+					{
+						if (skipWindow(window))
+							continue;
+						Boolean previousState = windowState.get(window);
+						if (previousState == null)
+							window.setVisible(true);
+						else if (previousState)
+							window.setVisible(previousState);
+					}
+					windowState.clear();
+					if (jEdit.getActiveView().getState() == Frame.ICONIFIED)
+						jEdit.getActiveView().setState(Frame.NORMAL);
+					jEdit.getActiveView().toFront();
+				}
+				else
+				{
+					for (Window window : Window.getOwnerlessWindows())
+					{
+						if (skipWindow(window))
+							continue;
+						windowState.put(window, window.isVisible());
+						window.setVisible(false);
+					}
+				}
+			}
+		}
+
+		//{{{ skipWindow method
+		/**
+		 * Check if a window is not top level or systray icon
+		 * @param window the checked window
+		 * @return true if it is not toplevel or systray icon
+		 */
+		private boolean skipWindow(Window window)
+		{
+			if (window.getClass().getName().contains("Tray"))
+				return true;
+			return false;
+		} //}}}
+
+	} //}}}
+
+	
+	
+	//{{{ MyActionListener class
+	private static class MyActionListener implements ActionListener
+	{
+		private final JMenuItem newViewItem;
+		private final JMenuItem newPlainViewItem;
+		private final JMenuItem exitItem;
+
+		MyActionListener(JMenuItem newViewItem, JMenuItem newPlainViewItem, JMenuItem exitItem)
+		{
+			this.newViewItem = newViewItem;
+			this.newPlainViewItem = newPlainViewItem;
+			this.exitItem = exitItem;
+		}
+
+		@Override
+		public void actionPerformed(ActionEvent e)
+		{
+			if (e.getSource() == newViewItem)
+			{
+				jEdit.newView(null);
+			} else if (e.getSource() == newPlainViewItem)
+			{
+				jEdit.newView(null, null, true);
+			} else if (e.getSource() == exitItem)
+			{
+				jEdit.exit(null, true);
+			}
+		}
+	} //}}}
+}
diff --git a/org/gjt/sp/jedit/gui/tray/JEditTrayIcon.java b/org/gjt/sp/jedit/gui/tray/JEditTrayIcon.java
index 7ba9a18..42e77db 100644
--- a/org/gjt/sp/jedit/gui/tray/JEditTrayIcon.java
+++ b/org/gjt/sp/jedit/gui/tray/JEditTrayIcon.java
@@ -1,41 +1,41 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.gui.tray;
-
-import java.awt.Image;
-
-/**
- * The mother class of the tray icon service.
- * If you want to replace the tray icon of jEdit, you must extend it
- * and declare a service "org.gjt.sp.jedit.gui.tray.JEditTrayIcon"
- * @see org.gjt.sp.jedit.ServiceManager
- * @author Matthieu Casanova
- */
-public abstract class JEditTrayIcon extends JTrayIcon
-{
-	protected JEditTrayIcon(Image image, String tooltip)
-	{
-		super(image, tooltip);
-	}
-
-	abstract void setTrayIconArgs(boolean restore, String userDir, String[] args);
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.gui.tray;
+
+import java.awt.Image;
+
+/**
+ * The mother class of the tray icon service.
+ * If you want to replace the tray icon of jEdit, you must extend it
+ * and declare a service "org.gjt.sp.jedit.gui.tray.JEditTrayIcon"
+ * @see org.gjt.sp.jedit.ServiceManager
+ * @author Matthieu Casanova
+ */
+public abstract class JEditTrayIcon extends JTrayIcon
+{
+	protected JEditTrayIcon(Image image, String tooltip)
+	{
+		super(image, tooltip);
+	}
+
+	abstract void setTrayIconArgs(boolean restore, String userDir, String[] args);
+}
diff --git a/org/gjt/sp/jedit/gui/tray/JTrayIcon.java b/org/gjt/sp/jedit/gui/tray/JTrayIcon.java
index b713a1b..80b54cc 100644
--- a/org/gjt/sp/jedit/gui/tray/JTrayIcon.java
+++ b/org/gjt/sp/jedit/gui/tray/JTrayIcon.java
@@ -1,135 +1,135 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.gui.tray;
-
-//{{{ Imports
-import java.awt.Frame;
-import java.awt.Image;
-import java.awt.TrayIcon;
-
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-
-import javax.swing.JDialog;
-import javax.swing.JPopupMenu;
-import javax.swing.event.PopupMenuEvent;
-import javax.swing.event.PopupMenuListener;
-
-import org.gjt.sp.jedit.GUIUtilities;
-//}}}
-
-/**
- * A TrayIcon that accepts Swing JPopupMenu.
- * @author Matthieu Casanova
- * @since jEdit 4.5pre1
- */
-public class JTrayIcon extends TrayIcon
-{
-	private JDialog parent;
-	private JPopupMenu menu;
-	private MouseListener mouseListener;
-	private PopupMenuListener popupMenuListener;
-
-	//{{{ JTrayIcon constructor
-	public JTrayIcon(Image image, String tooltip)
-	{
-		super(image, tooltip, null);
-
-	} //}}}
-
-	//{{{ getMenu() method
-	public JPopupMenu getMenu()
-	{
-		return menu;
-	} //}}}
-
-	//{{{ setMenu() method
-	public void setMenu(JPopupMenu menu)
-	{
-		if (menu == null)
-		{
-
-			if (mouseListener != null)
-			{
-				removeMouseListener(mouseListener);
-				mouseListener = null;
-			}
-			if (popupMenuListener != null)
-			{
-				this.menu.removePopupMenuListener(popupMenuListener);
-				popupMenuListener = null;
-			}
-			parent = null;
-		}
-		else
-		{
-			parent = new JDialog((Frame) null);
-			parent.setUndecorated(true);
-			parent.setAlwaysOnTop(true);
-			if (mouseListener == null)
-			{
-				mouseListener = new MyMouseListener();
-				addMouseListener(mouseListener);
-			}
-			popupMenuListener = new MyPopupMenuListener();
-			menu.addPopupMenuListener(popupMenuListener);
-		}
-		this.menu = menu;
-	} //}}}
-
-	//{{{ MyMouseListener class
-	private class MyMouseListener extends MouseAdapter
-	{
-		@Override
-		public void mouseClicked(MouseEvent e)
-		{
-			if (GUIUtilities.isPopupTrigger(e))
-			{
-				parent.setLocation(e.getX(), e.getY() - menu.getPreferredSize().height);
-				parent.setVisible(true);
-				menu.show(parent, 0, 0);
-			}
-		}
-	} //}}}
-
-	//{{{ MyPopupMenuListener class
-	private class MyPopupMenuListener implements PopupMenuListener
-	{
-		@Override
-		public void popupMenuWillBecomeVisible(PopupMenuEvent e)
-		{
-		}
-
-		@Override
-		public void popupMenuWillBecomeInvisible(PopupMenuEvent e)
-		{
-			parent.setVisible(false);
-		}
-
-		@Override
-		public void popupMenuCanceled(PopupMenuEvent e)
-		{
-			parent.setVisible(false);
-		}
-	} //}}}
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.gui.tray;
+
+//{{{ Imports
+import java.awt.Frame;
+import java.awt.Image;
+import java.awt.TrayIcon;
+
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+
+import javax.swing.JDialog;
+import javax.swing.JPopupMenu;
+import javax.swing.event.PopupMenuEvent;
+import javax.swing.event.PopupMenuListener;
+
+import org.gjt.sp.jedit.GUIUtilities;
+//}}}
+
+/**
+ * A TrayIcon that accepts Swing JPopupMenu.
+ * @author Matthieu Casanova
+ * @since jEdit 4.5pre1
+ */
+public class JTrayIcon extends TrayIcon
+{
+	private JDialog parent;
+	private JPopupMenu menu;
+	private MouseListener mouseListener;
+	private PopupMenuListener popupMenuListener;
+
+	//{{{ JTrayIcon constructor
+	public JTrayIcon(Image image, String tooltip)
+	{
+		super(image, tooltip, null);
+
+	} //}}}
+
+	//{{{ getMenu() method
+	public JPopupMenu getMenu()
+	{
+		return menu;
+	} //}}}
+
+	//{{{ setMenu() method
+	public void setMenu(JPopupMenu menu)
+	{
+		if (menu == null)
+		{
+
+			if (mouseListener != null)
+			{
+				removeMouseListener(mouseListener);
+				mouseListener = null;
+			}
+			if (popupMenuListener != null)
+			{
+				this.menu.removePopupMenuListener(popupMenuListener);
+				popupMenuListener = null;
+			}
+			parent = null;
+		}
+		else
+		{
+			parent = new JDialog((Frame) null);
+			parent.setUndecorated(true);
+			parent.setAlwaysOnTop(true);
+			if (mouseListener == null)
+			{
+				mouseListener = new MyMouseListener();
+				addMouseListener(mouseListener);
+			}
+			popupMenuListener = new MyPopupMenuListener();
+			menu.addPopupMenuListener(popupMenuListener);
+		}
+		this.menu = menu;
+	} //}}}
+
+	//{{{ MyMouseListener class
+	private class MyMouseListener extends MouseAdapter
+	{
+		@Override
+		public void mouseClicked(MouseEvent e)
+		{
+			if (GUIUtilities.isPopupTrigger(e))
+			{
+				parent.setLocation(e.getX(), e.getY() - menu.getPreferredSize().height);
+				parent.setVisible(true);
+				menu.show(parent, 0, 0);
+			}
+		}
+	} //}}}
+
+	//{{{ MyPopupMenuListener class
+	private class MyPopupMenuListener implements PopupMenuListener
+	{
+		@Override
+		public void popupMenuWillBecomeVisible(PopupMenuEvent e)
+		{
+		}
+
+		@Override
+		public void popupMenuWillBecomeInvisible(PopupMenuEvent e)
+		{
+			parent.setVisible(false);
+		}
+
+		@Override
+		public void popupMenuCanceled(PopupMenuEvent e)
+		{
+			parent.setVisible(false);
+		}
+	} //}}}
+}
diff --git a/org/gjt/sp/jedit/gui/tray/JTrayIconManager.java b/org/gjt/sp/jedit/gui/tray/JTrayIconManager.java
index 2cc09a5..b01cb6e 100644
--- a/org/gjt/sp/jedit/gui/tray/JTrayIconManager.java
+++ b/org/gjt/sp/jedit/gui/tray/JTrayIconManager.java
@@ -1,111 +1,111 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 jEdit contributors
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.gui.tray;
-
-//{{{ Imports
-import org.gjt.sp.jedit.EBComponent;
-import org.gjt.sp.jedit.EditBus;
-import org.gjt.sp.jedit.ServiceManager;
-import org.gjt.sp.jedit.jEdit;
-import org.gjt.sp.util.Log;
-
-import java.awt.*;
-//}}}
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 4.5pre1
- * 
- */
-public class JTrayIconManager
-{
-	private static JEditTrayIcon trayIcon;
-	private static boolean restore;
-	private static String userDir;
-	private static String[] args;
-
-	//{{{ setTrayIconArgs() method
-	public static void setTrayIconArgs(boolean restore, String userDir, String[] args)
-	{
-		JTrayIconManager.restore = restore;
-		JTrayIconManager.userDir = userDir;
-		JTrayIconManager.args = args;
-	} //}}}
-
-	//{{{ addTrayIcon() method
-	public static void addTrayIcon()
-	{
-		if (trayIcon == null && SystemTray.isSupported())
-		{
-
-			SystemTray systemTray = SystemTray.getSystemTray();
-			String trayIconName = jEdit.getProperty("systrayicon.service", "swing");
-			trayIcon = ServiceManager.getService(JEditTrayIcon.class, trayIconName);
-			if (trayIcon == null)
-			{
-				if ("swing".equals(trayIconName))
-				{
-					Log.log(Log.ERROR, JTrayIconManager.class, "No service " +
-						JEditTrayIcon.class.getName() + " with name swing");
-					return;
-				}
-				Log.log(Log.WARNING, JTrayIconManager.class, "No service " +
-					JEditTrayIcon.class.getName() + " with name "+ trayIconName);
-				trayIcon = ServiceManager.getService(JEditTrayIcon.class, "swing");
-			}
-			if (trayIcon == null)
-			{
-				Log.log(Log.ERROR, JTrayIconManager.class, "No service " +
-					JEditTrayIcon.class.getName() + " with name swing");
-				return;
-			}
-			trayIcon.setTrayIconArgs(restore, userDir, args);
-			try
-			{
-				systemTray.add(trayIcon);
-			}
-			catch (AWTException e)
-			{
-				Log.log(Log.ERROR, JEditSwingTrayIcon.class, "Unable to add Tray icon", e);
-				trayIcon = null;
-				return;
-			}
-			if (trayIcon instanceof EBComponent) {
-				EditBus.addToBus(trayIcon);
-			}
-		}
-	} //}}}
-
-	//{{{ removeTrayIcon() method
-	public static void removeTrayIcon()
-	{
-		if (trayIcon != null)
-		{
-			SystemTray.getSystemTray().remove(trayIcon);
-			if (trayIcon instanceof EBComponent) {
-				EditBus.removeFromBus(trayIcon);
-			}
-			trayIcon = null;
-		}
-	} //}}}
-
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 jEdit contributors
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.gui.tray;
+
+//{{{ Imports
+import org.gjt.sp.jedit.EBComponent;
+import org.gjt.sp.jedit.EditBus;
+import org.gjt.sp.jedit.ServiceManager;
+import org.gjt.sp.jedit.jEdit;
+import org.gjt.sp.util.Log;
+
+import java.awt.*;
+//}}}
+
+/**
+ * @author Matthieu Casanova
+ * @since jEdit 4.5pre1
+ * 
+ */
+public class JTrayIconManager
+{
+	private static JEditTrayIcon trayIcon;
+	private static boolean restore;
+	private static String userDir;
+	private static String[] args;
+
+	//{{{ setTrayIconArgs() method
+	public static void setTrayIconArgs(boolean restore, String userDir, String[] args)
+	{
+		JTrayIconManager.restore = restore;
+		JTrayIconManager.userDir = userDir;
+		JTrayIconManager.args = args;
+	} //}}}
+
+	//{{{ addTrayIcon() method
+	public static void addTrayIcon()
+	{
+		if (trayIcon == null && SystemTray.isSupported())
+		{
+
+			SystemTray systemTray = SystemTray.getSystemTray();
+			String trayIconName = jEdit.getProperty("systrayicon.service", "swing");
+			trayIcon = ServiceManager.getService(JEditTrayIcon.class, trayIconName);
+			if (trayIcon == null)
+			{
+				if ("swing".equals(trayIconName))
+				{
+					Log.log(Log.ERROR, JTrayIconManager.class, "No service " +
+						JEditTrayIcon.class.getName() + " with name swing");
+					return;
+				}
+				Log.log(Log.WARNING, JTrayIconManager.class, "No service " +
+					JEditTrayIcon.class.getName() + " with name "+ trayIconName);
+				trayIcon = ServiceManager.getService(JEditTrayIcon.class, "swing");
+			}
+			if (trayIcon == null)
+			{
+				Log.log(Log.ERROR, JTrayIconManager.class, "No service " +
+					JEditTrayIcon.class.getName() + " with name swing");
+				return;
+			}
+			trayIcon.setTrayIconArgs(restore, userDir, args);
+			try
+			{
+				systemTray.add(trayIcon);
+			}
+			catch (AWTException e)
+			{
+				Log.log(Log.ERROR, JEditSwingTrayIcon.class, "Unable to add Tray icon", e);
+				trayIcon = null;
+				return;
+			}
+			if (trayIcon instanceof EBComponent) {
+				EditBus.addToBus(trayIcon);
+			}
+		}
+	} //}}}
+
+	//{{{ removeTrayIcon() method
+	public static void removeTrayIcon()
+	{
+		if (trayIcon != null)
+		{
+			SystemTray.getSystemTray().remove(trayIcon);
+			if (trayIcon instanceof EBComponent) {
+				EditBus.removeFromBus(trayIcon);
+			}
+			trayIcon = null;
+		}
+	} //}}}
+
+}
diff --git a/org/gjt/sp/jedit/help/HelpHistoryModel.java b/org/gjt/sp/jedit/help/HelpHistoryModel.java
index bb79aa4..349f5bb 100644
--- a/org/gjt/sp/jedit/help/HelpHistoryModel.java
+++ b/org/gjt/sp/jedit/help/HelpHistoryModel.java
@@ -1,6 +1,6 @@
 /*
  * HelpHistoryModel.java - History Model for Help GUI
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Nicholas O'Leary
@@ -29,7 +29,7 @@ import java.util.ArrayList;
 /**
  * History model used by the help browser 
  * @author Nicholas O'Leary
- * @version $Id: HelpHistoryModel.java 14598 2009-02-07 18:52:28Z kpouer $
+ * @version $Id: HelpHistoryModel.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class HelpHistoryModel
 {
diff --git a/org/gjt/sp/jedit/help/HelpHistoryModelListener.java b/org/gjt/sp/jedit/help/HelpHistoryModelListener.java
index 579493f..6cd5cc2 100644
--- a/org/gjt/sp/jedit/help/HelpHistoryModelListener.java
+++ b/org/gjt/sp/jedit/help/HelpHistoryModelListener.java
@@ -1,6 +1,6 @@
 /*
  * HelpHistoryModelListener.java - History Model Listener for Help GUI
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Nicholas O'Leary
@@ -25,7 +25,7 @@ package org.gjt.sp.jedit.help;
 /**
  * Listener interface to montior changes to a HelpHistoryModel
  * @author Nicholas O'Leary
- * @version $Id: HelpHistoryModelListener.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: HelpHistoryModelListener.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public interface HelpHistoryModelListener
 {
diff --git a/org/gjt/sp/jedit/help/HelpIndex.java b/org/gjt/sp/jedit/help/HelpIndex.java
index 3b5341a..c3a9b82 100644
--- a/org/gjt/sp/jedit/help/HelpIndex.java
+++ b/org/gjt/sp/jedit/help/HelpIndex.java
@@ -1,6 +1,6 @@
 /*
  * HelpIndex.java - Index for help searching feature
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Slava Pestov
diff --git a/org/gjt/sp/jedit/help/HelpSearchPanel.java b/org/gjt/sp/jedit/help/HelpSearchPanel.java
index 4661d45..69cb877 100644
--- a/org/gjt/sp/jedit/help/HelpSearchPanel.java
+++ b/org/gjt/sp/jedit/help/HelpSearchPanel.java
@@ -1,6 +1,6 @@
 /*
  * HelpSearchPanel.java - Help search GUI
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Slava Pestov
diff --git a/org/gjt/sp/jedit/help/HelpTOCPanel.java b/org/gjt/sp/jedit/help/HelpTOCPanel.java
index 865b0bc..ff2c099 100644
--- a/org/gjt/sp/jedit/help/HelpTOCPanel.java
+++ b/org/gjt/sp/jedit/help/HelpTOCPanel.java
@@ -1,6 +1,6 @@
 /*
  * HelpTOCPanel.java - Help table of contents
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2004 Slava Pestov
diff --git a/org/gjt/sp/jedit/help/HelpViewer.java b/org/gjt/sp/jedit/help/HelpViewer.java
index 5acff97..eaaa9e9 100644
--- a/org/gjt/sp/jedit/help/HelpViewer.java
+++ b/org/gjt/sp/jedit/help/HelpViewer.java
@@ -1,6 +1,6 @@
 /*
  * HelpViewerDialog.java - HTML Help viewer
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2005 Slava Pestov, Nicholas O'Leary
@@ -78,7 +78,7 @@ import static org.gjt.sp.jedit.help.HelpHistoryModel.HistoryEntry;
  * jEdit's searchable help viewer. It uses a Swing JEditorPane to display the HTML,
  * and implements a URL history.
  * @author Slava Pestov
- * @version $Id: HelpViewer.java 21419 2012-03-23 08:21:20Z kpouer $
+ * @version $Id: HelpViewer.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class HelpViewer extends JFrame implements HelpViewerInterface, HelpHistoryModelListener
 {
diff --git a/org/gjt/sp/jedit/help/HistoryButton.java b/org/gjt/sp/jedit/help/HistoryButton.java
index ccdb2a9..18b2bf0 100644
--- a/org/gjt/sp/jedit/help/HistoryButton.java
+++ b/org/gjt/sp/jedit/help/HistoryButton.java
@@ -1,6 +1,6 @@
 /*
  * HistoryButton.java - History Button
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Nicholas O'Leary
@@ -34,7 +34,7 @@ import javax.swing.event.*;
 /**
  * History Button
  * @author Nicholas O'Leary
- * @version $Id: HistoryButton.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: HistoryButton.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class HistoryButton extends JPanel implements ActionListener
 {
diff --git a/org/gjt/sp/jedit/indent/BracketIndentRule.java b/org/gjt/sp/jedit/indent/BracketIndentRule.java
index a8b0202..4b4fe61 100644
--- a/org/gjt/sp/jedit/indent/BracketIndentRule.java
+++ b/org/gjt/sp/jedit/indent/BracketIndentRule.java
@@ -1,6 +1,6 @@
 /*
  * BracketIndentRule.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
@@ -30,7 +30,7 @@ import org.gjt.sp.jedit.syntax.TokenMarker;
 
 /**
  * @author Slava Pestov
- * @version $Id: BracketIndentRule.java 21723 2012-05-27 14:34:13Z k_satoda $
+ * @version $Id: BracketIndentRule.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public abstract class BracketIndentRule implements IndentRule
 {
diff --git a/org/gjt/sp/jedit/indent/CloseBracketIndentRule.java b/org/gjt/sp/jedit/indent/CloseBracketIndentRule.java
index 4819402..998bab0 100644
--- a/org/gjt/sp/jedit/indent/CloseBracketIndentRule.java
+++ b/org/gjt/sp/jedit/indent/CloseBracketIndentRule.java
@@ -1,6 +1,6 @@
 /*
  * CloseBracketIndentRule.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
@@ -29,7 +29,7 @@ import org.gjt.sp.util.StandardUtilities;
 
 /**
  * @author Slava Pestov
- * @version $Id: CloseBracketIndentRule.java 21723 2012-05-27 14:34:13Z k_satoda $
+ * @version $Id: CloseBracketIndentRule.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class CloseBracketIndentRule extends BracketIndentRule
 {
diff --git a/org/gjt/sp/jedit/indent/DeepIndentRule.java b/org/gjt/sp/jedit/indent/DeepIndentRule.java
index 0bd4dca..00c6bfb 100644
--- a/org/gjt/sp/jedit/indent/DeepIndentRule.java
+++ b/org/gjt/sp/jedit/indent/DeepIndentRule.java
@@ -1,6 +1,6 @@
 /*
  * DeepIndentRule.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
@@ -37,7 +37,7 @@ import javax.swing.text.Segment;
  * Deep indent rule.
  *
  * @author Matthieu Casanova
- * @version $Id: DeepIndentRule.java 21723 2012-05-27 14:34:13Z k_satoda $
+ * @version $Id: DeepIndentRule.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class DeepIndentRule implements IndentRule
 {
diff --git a/org/gjt/sp/jedit/indent/IndentAction.java b/org/gjt/sp/jedit/indent/IndentAction.java
index 860c5ae..864b6b8 100644
--- a/org/gjt/sp/jedit/indent/IndentAction.java
+++ b/org/gjt/sp/jedit/indent/IndentAction.java
@@ -1,6 +1,6 @@
 /*
  * IndentAction.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
@@ -27,7 +27,7 @@ import org.gjt.sp.util.StandardUtilities;
 
 /** Abstract Indentation Action 
  * @author Slava Pestov
- * @version $Id: IndentAction.java 21398 2012-03-20 04:32:13Z ezust $
+ * @version $Id: IndentAction.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public interface IndentAction
 {
diff --git a/org/gjt/sp/jedit/indent/IndentRule.java b/org/gjt/sp/jedit/indent/IndentRule.java
index 25d00be..dc62478 100644
--- a/org/gjt/sp/jedit/indent/IndentRule.java
+++ b/org/gjt/sp/jedit/indent/IndentRule.java
@@ -1,6 +1,6 @@
 /*
  * IndentRule.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
@@ -27,7 +27,7 @@ import org.gjt.sp.jedit.buffer.JEditBuffer;
 
 /** Abstract Indentation Rule 
  * @author Slava Pestov
- * @version $Id: IndentRule.java 21723 2012-05-27 14:34:13Z k_satoda $
+ * @version $Id: IndentRule.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public interface IndentRule
 {
diff --git a/org/gjt/sp/jedit/indent/IndentRuleFactory.java b/org/gjt/sp/jedit/indent/IndentRuleFactory.java
index 0f92d80..41a05ed 100644
--- a/org/gjt/sp/jedit/indent/IndentRuleFactory.java
+++ b/org/gjt/sp/jedit/indent/IndentRuleFactory.java
@@ -1,6 +1,6 @@
 /*
  * IndentRuleFactory.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
diff --git a/org/gjt/sp/jedit/indent/OpenBracketIndentRule.java b/org/gjt/sp/jedit/indent/OpenBracketIndentRule.java
index 22c8382..270a1ca 100644
--- a/org/gjt/sp/jedit/indent/OpenBracketIndentRule.java
+++ b/org/gjt/sp/jedit/indent/OpenBracketIndentRule.java
@@ -1,6 +1,6 @@
 /*
  * OpenBracketIndentRule.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
@@ -28,7 +28,7 @@ import org.gjt.sp.jedit.TextUtilities;
 
 /**
  * @author Slava Pestov
- * @version $Id: OpenBracketIndentRule.java 21723 2012-05-27 14:34:13Z k_satoda $
+ * @version $Id: OpenBracketIndentRule.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class OpenBracketIndentRule extends BracketIndentRule
 {
diff --git a/org/gjt/sp/jedit/indent/RegexpIndentRule.java b/org/gjt/sp/jedit/indent/RegexpIndentRule.java
index 06791d8..495862a 100644
--- a/org/gjt/sp/jedit/indent/RegexpIndentRule.java
+++ b/org/gjt/sp/jedit/indent/RegexpIndentRule.java
@@ -1,6 +1,6 @@
 /*
  * RegexpIndentRule.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
@@ -36,7 +36,7 @@ import org.gjt.sp.jedit.syntax.TokenMarker;
 
 /**
  * @author Slava Pestov
- * @version $Id: RegexpIndentRule.java 21723 2012-05-27 14:34:13Z k_satoda $
+ * @version $Id: RegexpIndentRule.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class RegexpIndentRule implements IndentRule
 {
diff --git a/org/gjt/sp/jedit/indent/WhitespaceRule.java b/org/gjt/sp/jedit/indent/WhitespaceRule.java
index 6a36591..908d17a 100644
--- a/org/gjt/sp/jedit/indent/WhitespaceRule.java
+++ b/org/gjt/sp/jedit/indent/WhitespaceRule.java
@@ -1,6 +1,6 @@
 /*
  * WhitespaceRule.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Marcelo Vanzin
@@ -40,7 +40,7 @@ import org.gjt.sp.jedit.buffer.JEditBuffer;
  * If the requirements above do not apply, this rule does nothing.</p>
  *
  * @author Marcelo Vanzin
- * @version $Id: WhitespaceRule.java 21723 2012-05-27 14:34:13Z k_satoda $
+ * @version $Id: WhitespaceRule.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.3pre10
  */
 public class WhitespaceRule implements IndentRule
diff --git a/org/gjt/sp/jedit/input/AbstractInputHandler.java b/org/gjt/sp/jedit/input/AbstractInputHandler.java
index ce62f62..f717b61 100644
--- a/org/gjt/sp/jedit/input/AbstractInputHandler.java
+++ b/org/gjt/sp/jedit/input/AbstractInputHandler.java
@@ -1,6 +1,6 @@
 /*
  * AbstractInputHandler.java - Manages key bindings and executes actions
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
@@ -39,7 +39,7 @@ import org.gjt.sp.jedit.gui.ShortcutPrefixActiveEvent;
  * The abstract input handler manage the keyboard handling.
  * The entry point is
  * {@link #processKeyEvent(java.awt.event.KeyEvent, int, boolean)}
- * 
+ *
  * @author Matthieu Casanova
  * @version $Id: FoldHandler.java 5568 2006-07-10 20:52:23Z kpouer $
  */
@@ -60,7 +60,7 @@ public abstract class AbstractInputHandler<E extends JEditAbstractEditAction>
 	{
 		repeatCount = 1;
 	} //}}}
-	
+
 	//{{{ addKeyBinding() method
 	/**
 	 * Adds a key binding to this input handler. The key binding is
@@ -143,8 +143,8 @@ public abstract class AbstractInputHandler<E extends JEditAbstractEditAction>
 
 	//{{{ removeKeyBinding() method
 	/**
-	 * Removes a key binding from this input handler. This is not yet
-	 * implemented.
+	 * Removes a key binding from this input handler.
+	 *
 	 * @param keyBinding The key binding
 	 */
 	public void removeKeyBinding(String keyBinding)
@@ -284,7 +284,7 @@ public abstract class AbstractInputHandler<E extends JEditAbstractEditAction>
 	{
 		return readNextChar != null;
 	} //}}}
-	
+
 	//{{{ setBindings() method
 	/**
 	 * Replace the set of key bindings.
@@ -294,7 +294,7 @@ public abstract class AbstractInputHandler<E extends JEditAbstractEditAction>
 	{
 		this.bindings = this.currentBindings = bindings;
 	} //}}}
-	
+
 	//{{{ setCurrentBindings() method
 	public void setCurrentBindings(Hashtable bindings)
 	{
@@ -323,7 +323,7 @@ public abstract class AbstractInputHandler<E extends JEditAbstractEditAction>
 	 * {@link org.gjt.sp.jedit.View#ACTION_BAR} or {@link org.gjt.sp.jedit.View#TEXT_AREA}
 	 * @param global tell if the event comes from the DefaultKeyboardFocusManager or not
 	 */
-	public abstract void processKeyEvent(KeyEvent evt, int from, boolean global); 
+	public abstract void processKeyEvent(KeyEvent evt, int from, boolean global);
 	//}}}
 
 	//{{{ sendShortcutPrefixOff() method
@@ -335,9 +335,9 @@ public abstract class AbstractInputHandler<E extends JEditAbstractEditAction>
 			shortcutOn = false;
 		}
 	} //}}}
-	
+
 	public abstract void invokeAction(String action);
-	
+
 	public abstract void invokeAction(E action);
 
 	//{{{ toString() method
@@ -387,7 +387,7 @@ public abstract class AbstractInputHandler<E extends JEditAbstractEditAction>
 	 * @param evt the keyboard event
 	 * @param from the source, it can be {@link org.gjt.sp.jedit.View#VIEW},
 	 * {@link org.gjt.sp.jedit.View#ACTION_BAR} or {@link org.gjt.sp.jedit.View#TEXT_AREA}
-	 * @param mode the mode is "press" or "type" and is used for debug only  
+	 * @param mode the mode is "press" or "type" and is used for debug only
 	 * @param global tell if the event comes from the DefaultKeyboardFocusManager or not
 	 */
 	protected void processKeyEventKeyStrokeHandling(KeyEvent evt, int from, String mode, boolean global)
@@ -414,13 +414,13 @@ public abstract class AbstractInputHandler<E extends JEditAbstractEditAction>
 			}
 		}
 	} //}}}
-	
+
 	//{{{ Private members
 
 	// Stores prefix name in bindings hashtable
 	public static Object PREFIX_STR = "PREFIX_STR";
 	protected boolean shortcutOn = false;
-	
+
 
 	protected Hashtable bindings;
 	protected Hashtable currentBindings;
diff --git a/org/gjt/sp/jedit/input/DefaultInputHandlerProvider.java b/org/gjt/sp/jedit/input/DefaultInputHandlerProvider.java
index 6322f9f..e468f2f 100644
--- a/org/gjt/sp/jedit/input/DefaultInputHandlerProvider.java
+++ b/org/gjt/sp/jedit/input/DefaultInputHandlerProvider.java
@@ -1,6 +1,6 @@
 /*
  * DefaultInputHandlerProvider.java - This class provide the input handler
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/input/InputHandlerProvider.java b/org/gjt/sp/jedit/input/InputHandlerProvider.java
index f50cdcf..ad16d4d 100644
--- a/org/gjt/sp/jedit/input/InputHandlerProvider.java
+++ b/org/gjt/sp/jedit/input/InputHandlerProvider.java
@@ -1,6 +1,6 @@
 /*
  * InputHandlerProvider.java - The input handler provider
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/input/TextAreaInputHandler.java b/org/gjt/sp/jedit/input/TextAreaInputHandler.java
index 52927bf..828a949 100644
--- a/org/gjt/sp/jedit/input/TextAreaInputHandler.java
+++ b/org/gjt/sp/jedit/input/TextAreaInputHandler.java
@@ -1,6 +1,6 @@
 /*
  * TextAreaInputHandler.java - Manages key bindings and executes actions
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/io/AutoDetection.java b/org/gjt/sp/jedit/io/AutoDetection.java
index 14c3f0b..61c6354 100644
--- a/org/gjt/sp/jedit/io/AutoDetection.java
+++ b/org/gjt/sp/jedit/io/AutoDetection.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Kazutoshi Satoda
diff --git a/org/gjt/sp/jedit/io/CharsetEncoding.java b/org/gjt/sp/jedit/io/CharsetEncoding.java
index edcac86..be17a7c 100644
--- a/org/gjt/sp/jedit/io/CharsetEncoding.java
+++ b/org/gjt/sp/jedit/io/CharsetEncoding.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Kazutoshi Satoda
@@ -21,23 +21,24 @@
 package org.gjt.sp.jedit.io;
 
 //{{{ Imports
+import java.io.IOException;
 import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.io.OutputStream;
+import java.io.OutputStreamWriter;
 import java.io.Reader;
 import java.io.Writer;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CodingErrorAction;
+import javax.annotation.Nonnull;
 //}}}
 
 /**
  * Encodings which are provided by java.nio.charset.Charset.
  *
- * @since 4.3pre10
  * @author Kazutoshi Satoda
+ * @since 4.3pre10
  */
 public class CharsetEncoding implements Encoding
 {
@@ -48,7 +49,8 @@ public class CharsetEncoding implements Encoding
 	} //}}}
 
 	//{{{ implements Encoding
-	public Reader getTextReader(InputStream in) throws IOException
+	@Nonnull
+	public Reader getTextReader(@Nonnull InputStream in) throws IOException
 	{
 		// Pass the decoder explicitly to report a decode error
 		// as an exception instead of replacing with "\uFFFD".
@@ -57,14 +59,16 @@ public class CharsetEncoding implements Encoding
 		return new InputStreamReader(in, body.newDecoder());
 	}
 
-	public Writer getTextWriter(OutputStream out) throws IOException
+	@Nonnull
+	public Writer getTextWriter(@Nonnull OutputStream out) throws IOException
 	{
 		// Pass the encoder explicitly because of same reason
 		// in getTextReader();
 		return new OutputStreamWriter(out, body.newEncoder());
 	}
 
-	public Reader getPermissiveTextReader(InputStream in) throws IOException
+	@Nonnull
+	public Reader getPermissiveTextReader(@Nonnull InputStream in) throws IOException
 	{
 		// Use REPLACE action to indicate where the coding error
 		// happened by the replacement character "\uFFFD".
diff --git a/org/gjt/sp/jedit/io/CopyFileWorker.java b/org/gjt/sp/jedit/io/CopyFileWorker.java
index ec684c0..8363c25 100644
--- a/org/gjt/sp/jedit/io/CopyFileWorker.java
+++ b/org/gjt/sp/jedit/io/CopyFileWorker.java
@@ -1,6 +1,6 @@
 /*
  * CopyFileWorker.java - a worker that will copy a file
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008, 2012 Matthieu Casanova
@@ -28,6 +28,8 @@ import java.io.IOException;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
 
+import javax.annotation.Nullable;
+
 import org.gjt.sp.jedit.MiscUtilities;
 import org.gjt.sp.util.Log;
 import org.gjt.sp.util.Task;
@@ -47,7 +49,7 @@ public class CopyFileWorker extends Task
 	 * The behavior if the target already exists
 	 * @since jEdit 5.0
 	 */
-	enum Behavior 
+	public enum Behavior
 	{ 
 		/** Do not copy file. */
 		SKIP, 
@@ -96,7 +98,7 @@ public class CopyFileWorker extends Task
 	 * @param target the target path (it is the file path, not a parent directory)
 	 * @param latch a latch so the caller knows when the copy is done
 	 */
-	private CopyFileWorker(Component comp, String source, String target, CountDownLatch latch)
+	private CopyFileWorker(Component comp, String source, String target, @Nullable CountDownLatch latch)
 	{
 		if (source == null || target == null)
 			throw new NullPointerException("The source and target cannot be null");
@@ -249,6 +251,7 @@ public class CopyFileWorker extends Task
 	} //}}}
 
 	//{{{ getTargetName() method
+	@Nullable
 	private String getTargetName(Object session, VFS vfs, String path, String baseName) throws IOException
 	{
 		if (behavior == Behavior.OVERWRITE)
diff --git a/org/gjt/sp/jedit/io/Encoding.java b/org/gjt/sp/jedit/io/Encoding.java
index 871af5a..186afa2 100644
--- a/org/gjt/sp/jedit/io/Encoding.java
+++ b/org/gjt/sp/jedit/io/Encoding.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Kazutoshi Satoda
@@ -20,11 +20,12 @@
 
 package org.gjt.sp.jedit.io;
 
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.Reader;
 import java.io.Writer;
-import java.io.IOException;
+import javax.annotation.Nonnull;
 
 /**
  * An interface to represent an encoding.
@@ -45,20 +46,22 @@ public interface Encoding
 	* Decode-error while reading from this Reader should be reported
 	* by throwing an IOException.
 	*/
-	Reader getTextReader(InputStream in) throws IOException;
-	
+	@Nonnull
+	Reader getTextReader(@Nonnull InputStream in) throws IOException;
+
 	/**
 	* Map an OutputStream to a Writer.
 	* Encode-error while writing to this Writer should be reported
 	* by throwing an IOException.
 	*/
-	Writer getTextWriter(OutputStream out) throws IOException;
+	@Nonnull
+	Writer getTextWriter(@Nonnull OutputStream out) throws IOException;
 
 	/**
 	* Map an InputStream to a Reader.
 	* Decode-error while reading from this Reader should be ignored
 	* or replaced.
 	*/
-	Reader getPermissiveTextReader(InputStream in)
-		throws IOException;
+	@Nonnull
+	Reader getPermissiveTextReader(@Nonnull InputStream in) throws IOException;
 }
diff --git a/org/gjt/sp/jedit/io/EncodingDetector.java b/org/gjt/sp/jedit/io/EncodingDetector.java
index 3b730f2..b25344a 100644
--- a/org/gjt/sp/jedit/io/EncodingDetector.java
+++ b/org/gjt/sp/jedit/io/EncodingDetector.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Kazutoshi Satoda
diff --git a/org/gjt/sp/jedit/io/EncodingServer.java b/org/gjt/sp/jedit/io/EncodingServer.java
index a57dabf..4a12dd2 100644
--- a/org/gjt/sp/jedit/io/EncodingServer.java
+++ b/org/gjt/sp/jedit/io/EncodingServer.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Kazutoshi Satoda
diff --git a/org/gjt/sp/jedit/io/EncodingWithBOM.java b/org/gjt/sp/jedit/io/EncodingWithBOM.java
index f128aca..57ca2ef 100644
--- a/org/gjt/sp/jedit/io/EncodingWithBOM.java
+++ b/org/gjt/sp/jedit/io/EncodingWithBOM.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Kazutoshi Satoda
@@ -21,18 +21,19 @@
 package org.gjt.sp.jedit.io;
 
 //{{{ Imports
-import java.io.InputStream;
-import java.io.SequenceInputStream;
 import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.Reader;
+import java.io.SequenceInputStream;
 import java.io.Writer;
-import java.io.IOException;
-import java.nio.charset.UnsupportedCharsetException;
 import java.nio.charset.MalformedInputException;
+import java.nio.charset.UnsupportedCharsetException;
 import java.util.Arrays;
-import java.util.Map;
 import java.util.HashMap;
+import java.util.Map;
+import javax.annotation.Nonnull;
 //}}}
 
 /**
@@ -56,7 +57,8 @@ public class EncodingWithBOM implements Encoding
 	} //}}}
 
 	//{{{ implements Encoding
-	public Reader getTextReader(InputStream in) throws IOException
+	@Nonnull
+	public Reader getTextReader(@Nonnull InputStream in) throws IOException
 	{
 		byte[] actualMark = new byte[bom.length];
 		int count = in.read(actualMark);
@@ -67,13 +69,15 @@ public class EncodingWithBOM implements Encoding
 		return plain.getTextReader(in);
 	}
 
-	public Writer getTextWriter(OutputStream out) throws IOException
+	@Nonnull
+	public Writer getTextWriter(@Nonnull OutputStream out) throws IOException
 	{
 		out.write(bom);
 		return plain.getTextWriter(out);
 	}
 
-	public Reader getPermissiveTextReader(InputStream in) throws IOException
+	@Nonnull
+	public Reader getPermissiveTextReader(@Nonnull InputStream in) throws IOException
 	{
 		byte[] actualMark = new byte[bom.length];
 		int count = in.read(actualMark);
@@ -97,7 +101,7 @@ public class EncodingWithBOM implements Encoding
 		{
 			byte[] mark = new byte[4];
 			int count = sample.read(mark);
-	
+
 			byte low = (byte)(BOM16 & 0xff);
 			byte high = (byte)((BOM16 >> 8) & 0xff);
 			if (count >= 4)
@@ -128,7 +132,7 @@ public class EncodingWithBOM implements Encoding
 					return "UTF-16";
 				}
 			}
-	
+
 			if (count >= UTF8BOM.length)
 			{
 				int i = 0;
@@ -145,7 +149,7 @@ public class EncodingWithBOM implements Encoding
 					return "UTF-8Y";
 				}
 			}
-	
+
 			return null;
 		}
 	} //}}}
diff --git a/org/gjt/sp/jedit/io/FavoritesVFS.java b/org/gjt/sp/jedit/io/FavoritesVFS.java
index 42b6966..ea92325 100644
--- a/org/gjt/sp/jedit/io/FavoritesVFS.java
+++ b/org/gjt/sp/jedit/io/FavoritesVFS.java
@@ -1,6 +1,6 @@
 /*
  * FavoritesVFS.java - Stores frequently-visited directory locations
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2004 Slava Pestov
@@ -38,7 +38,7 @@ import org.gjt.sp.jedit.*;
  * favorite and clicking 'delete' in the browser just deletes the
  * favorite, and not the directory itself.
  * @author Slava Pestov
- * @version $Id: FavoritesVFS.java 21627 2012-05-04 16:58:22Z jarekczek $
+ * @version $Id: FavoritesVFS.java 22828 2013-03-05 19:40:05Z ezust $
  */
 public class FavoritesVFS extends VFS
 {
@@ -195,7 +195,7 @@ public class FavoritesVFS extends VFS
 				String p = favorite.getPath();
 				String l = favorite.getLabel();
 				jEdit.setProperty("vfs.favorite." + i, p);
-				if (p.equals(l) || MiscUtilities.abbreviate(p).equals(l))
+				if (p.equals(l) || MiscUtilities.abbreviateView(p).equals(l))
 					jEdit.unsetProperty("vfs.favorite." + i + ".label");
 				else 
 					jEdit.setProperty("vfs.favorite." + i + ".label", l);
@@ -236,7 +236,7 @@ public class FavoritesVFS extends VFS
 		Favorite(String path, int type)
 		{
 			super(path,path,PROTOCOL + ':' + path,type, 0L,false);
-			this.label = MiscUtilities.abbreviate(path);
+			this.label = MiscUtilities.abbreviateView(path);
 		}
 
 		public String getLabel()
diff --git a/org/gjt/sp/jedit/io/FileRootsVFS.java b/org/gjt/sp/jedit/io/FileRootsVFS.java
index 944fb9d..5149810 100644
--- a/org/gjt/sp/jedit/io/FileRootsVFS.java
+++ b/org/gjt/sp/jedit/io/FileRootsVFS.java
@@ -1,6 +1,6 @@
 /*
  * FileRootsVFS.java - Local root filesystems VFS
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2005 Slava Pestov
@@ -36,7 +36,7 @@ import org.gjt.sp.jedit.OperatingSystem;
 /**
  * A VFS that lists local root filesystems.
  * @author Slava Pestov
- * @version $Id: FileRootsVFS.java 21627 2012-05-04 16:58:22Z jarekczek $
+ * @version $Id: FileRootsVFS.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class FileRootsVFS extends VFS
 {
diff --git a/org/gjt/sp/jedit/io/FileVFS.java b/org/gjt/sp/jedit/io/FileVFS.java
index 2c01b1a..2e5903e 100644
--- a/org/gjt/sp/jedit/io/FileVFS.java
+++ b/org/gjt/sp/jedit/io/FileVFS.java
@@ -1,6 +1,6 @@
 /*
  * FileVFS.java - Local filesystem VFS
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2005 Slava Pestov
@@ -25,6 +25,8 @@
 package org.gjt.sp.jedit.io;
 
 //{{{ Imports
+import java.io.Closeable;
+
 import javax.swing.filechooser.FileSystemView;
 import javax.swing.*;
 import java.awt.Component;
@@ -39,7 +41,7 @@ import org.gjt.sp.util.Log;
 /**
  * Local filesystem VFS.
  * @author Slava Pestov
- * @version $Id: FileVFS.java 21721 2012-05-27 09:03:56Z jarekczek $
+ * @version $Id: FileVFS.java 22774 2013-02-12 06:55:37Z ezust $
  */
 public class FileVFS extends VFS
 {
@@ -358,11 +360,12 @@ public class FileVFS extends VFS
 
 		File directory = new File(path);
 		File[] list = null;
-		if(directory.exists())
+		if(directory.exists()) 
+		{
 			if (fsView == null)
 				fsView = FileSystemView.getFileSystemView();
 			list = fsView.getFiles(directory,false);
-
+		}
 		if(list == null)
 		{
 			VFSManager.error(comp,path,"ioerror.directory-error-nomsg",null);
@@ -590,7 +593,7 @@ public class FileVFS extends VFS
 			}
 			finally
 			{
-				IOUtilities.closeQuietly(reader);
+				IOUtilities.closeQuietly((Closeable)reader);
 			}
 		}
 
diff --git a/org/gjt/sp/jedit/io/LocalFileSaveTask.java b/org/gjt/sp/jedit/io/LocalFileSaveTask.java
index 3cb7068..c06fcf3 100644
--- a/org/gjt/sp/jedit/io/LocalFileSaveTask.java
+++ b/org/gjt/sp/jedit/io/LocalFileSaveTask.java
@@ -1,8 +1,9 @@
 /**
- * 
+ *
  */
 package org.gjt.sp.jedit.io;
 
+import java.io.Closeable;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -16,75 +17,75 @@ import org.gjt.sp.util.Task;
 /**
  * The Task for asynchronous saving local file to disk ommiting VFS API stack.
  * Can be used to store backup files, settings, etc
- * 
+ *
  * @example
  * 	This class used for example by ftp.FtpVFS to perform local backups of remote files in background with no GUI freeze
- * 
+ *
  * @example
  * 	ThreadUtilities.runInBackground( new LocalFileSaveTask(...) )
- * 
+ *
  * @author Vadim Voituk
  * @since jEdit 4.5pre
- * 
+ *
  * TODO: Add setLabel() && ProgressObserver methods
  */
-public class LocalFileSaveTask extends Task 
+public class LocalFileSaveTask extends Task
 {
 
 	private static final int BUFFER_SIZE = 4096;
-	
+
 	private File file;
 	private String body;
 	private String charset;
 
-	public LocalFileSaveTask(File file, String body, String charset) 
+	public LocalFileSaveTask(File file, String body, String charset)
 	{
 		this.file = file;
 		this.body = body;
 		this.charset = charset;
 	}
-	
+
 	/**
 	 * @see org.gjt.sp.util.Task#_run()
 	 */
 	@Override
-	public void _run() 
+	public void _run()
 	{
 		FileOutputStream os = null;
 		FileChannel ch      = null;
-		try 
+		try
 		{
 			os = new FileOutputStream(file);
 			ch = os.getChannel();
 			byte[] src = body.getBytes(charset);
-			
+
 			os = new FileOutputStream(file);
 			ch = os.getChannel();
-			
+
 			ByteBuffer buff = ByteBuffer.allocate(BUFFER_SIZE);
-			
+
 			int length = src.length;
 			setMaximum(length);
 			setStatus("Saving " + length + " bytes to " + file.getPath() ); //TODO: Change this
-			
+
 			int written = 0;
-			
-			while (written < length) 
+
+			while (written < length)
 			{
 				written += ch.write( (ByteBuffer)buff.put(src, written, Math.min(BUFFER_SIZE, length-written) ).flip() );
 				buff.rewind();
 				setValue(written);
 			}
-			
-		} 
-		catch (IOException e) 
+
+		}
+		catch (IOException e)
 		{
 			Log.log(Log.ERROR, this, e, e);
-		} 
-		finally 
+		}
+		finally
 		{
-			IOUtilities.closeQuietly(ch);
-			IOUtilities.closeQuietly(os);
+			IOUtilities.closeQuietly((Closeable)ch);
+			IOUtilities.closeQuietly((Closeable)os);
 		}
 	}
 
diff --git a/org/gjt/sp/jedit/io/RegexEncodingDetector.java b/org/gjt/sp/jedit/io/RegexEncodingDetector.java
index 434d9e9..36c0a9c 100644
--- a/org/gjt/sp/jedit/io/RegexEncodingDetector.java
+++ b/org/gjt/sp/jedit/io/RegexEncodingDetector.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Kazutoshi Satoda
diff --git a/org/gjt/sp/jedit/io/UrlVFS.java b/org/gjt/sp/jedit/io/UrlVFS.java
index fc3a502..bcab683 100644
--- a/org/gjt/sp/jedit/io/UrlVFS.java
+++ b/org/gjt/sp/jedit/io/UrlVFS.java
@@ -1,6 +1,6 @@
 /*
  * UrlVFS.java - URL VFS
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000 Slava Pestov
@@ -32,7 +32,7 @@ import org.gjt.sp.util.Log;
 /**
  * URL VFS.
  * @author Slava Pestov
- * @version $Id: UrlVFS.java 21627 2012-05-04 16:58:22Z jarekczek $
+ * @version $Id: UrlVFS.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class UrlVFS extends VFS
 {
diff --git a/org/gjt/sp/jedit/io/VFS.java b/org/gjt/sp/jedit/io/VFS.java
index 8d2d89c..3c59213 100644
--- a/org/gjt/sp/jedit/io/VFS.java
+++ b/org/gjt/sp/jedit/io/VFS.java
@@ -1,6 +1,6 @@
 /*
  * VFS.java - Virtual filesystem implementation
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2003 Slava Pestov
@@ -26,6 +26,7 @@ package org.gjt.sp.jedit.io;
 import java.awt.Color;
 import java.awt.Component;
 import java.io.*;
+import java.io.Closeable;
 import java.util.*;
 
 import java.util.regex.Pattern;
@@ -36,13 +37,12 @@ import org.gjt.sp.jedit.*;
 import org.gjt.sp.jedit.bufferio.BufferLoadRequest;
 import org.gjt.sp.jedit.bufferio.BufferSaveRequest;
 import org.gjt.sp.jedit.bufferio.BufferInsertRequest;
-import org.gjt.sp.jedit.bufferio.BufferIORequest;
 import org.gjt.sp.util.Log;
 import org.gjt.sp.util.ProgressObserver;
 import org.gjt.sp.util.IOUtilities;
 import org.gjt.sp.util.StandardUtilities;
+import org.gjt.sp.util.Task;
 import org.gjt.sp.util.ThreadUtilities;
-import org.gjt.sp.util.WorkThread;
 //}}}
 
 /**
@@ -104,7 +104,7 @@ import org.gjt.sp.util.WorkThread;
  * @see VFSManager#getVFSForProtocol(String)
  *
  * @author Slava Pestov
- * @author $Id: VFS.java 22457 2012-11-11 17:16:21Z ezust $
+ * @author $Id: VFS.java 22454 2012-11-10 11:15:08Z thomasmey $
  */
 public abstract class VFS
 {
@@ -442,9 +442,9 @@ public abstract class VFS
 	{
 		return new Object();
 	}
-	
+
 	/**
-	* Same as {@link #createVFSSession}, but may be called fromy any
+	* Same as {@link #createVFSSession}, but may be called from any
 	* thread. It first checks the <code>NON_AWT_SESSION_CAP</code>
 	* capability and enters EDT thread if necessary.
 	*/
@@ -489,7 +489,7 @@ public abstract class VFS
 		if((getCapabilities() & WRITE_CAP) == 0)
 			buffer.setReadOnly(true);
 
-		BufferIORequest request = new BufferLoadRequest(view, buffer, session, this, path);
+		Task request = new BufferLoadRequest(view, buffer, session, this, path);
 		if(buffer.isTemporary())
 			// this makes HyperSearch much faster
 			request.run();
@@ -497,7 +497,7 @@ public abstract class VFS
 			// BufferLoadRequest can cause UI interations (for example FTP connection dialog),
 			// so it should be runned in Dispatch thread
 			//ThreadUtilities.runInDispatchThread(request);
-			VFSManager.runInWorkThread(request);
+			ThreadUtilities.runInBackground(request);
 
 		return true;
 	} //}}}
@@ -530,7 +530,7 @@ public abstract class VFS
 		if(!path.equals(buffer.getPath()))
 			buffer.unsetProperty(Buffer.BACKED_UP);
 
-		VFSManager.runInWorkThread(new BufferSaveRequest(
+		ThreadUtilities.runInBackground(new BufferSaveRequest(
 			view,buffer,session,this,path));
 		return true;
 	} //}}}
@@ -549,7 +549,7 @@ public abstract class VFS
 	 * @param targetPath the target path.
 	 * If it is a path, it must exists, if it is a file, the parent must
 	 * exists
-	 * @param comp comp The component that will parent error dialog boxes
+	 * @param comp The component that will parent error dialog boxes
 	 * @param canStop could this copy be stopped ?
 	 * @return true if the copy was successful
 	 * @throws IOException  IOException If an I/O error occurs
@@ -576,7 +576,7 @@ public abstract class VFS
 	 * @param targetPath the target path.
 	 * If it is a path, it must exists, if it is a file, the parent must
 	 * exists
-	 * @param comp comp The component that will parent error dialog boxes
+	 * @param comp The component that will parent error dialog boxes
 	 * @param canStop could this copy be stopped ?
 	 * @param sendVFSUpdate true if you want to send a VFS update after the copy. False otherwise (if you do a lot
 	 *                      of copy)
@@ -643,8 +643,8 @@ public abstract class VFS
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(in);
-			IOUtilities.closeQuietly(out);
+			IOUtilities.closeQuietly((Closeable)in);
+			IOUtilities.closeQuietly((Closeable)out);
 		}
 	}
 
@@ -655,7 +655,7 @@ public abstract class VFS
 	 *                  you should probably launch this command in a WorkThread
 	 * @param sourcePath the source path
 	 * @param targetPath the target path
-	 * @param comp comp The component that will parent error dialog boxes
+	 * @param comp The component that will parent error dialog boxes
 	 * @param canStop if true the copy can be stopped
 	 * @param sendVFSUpdate true if you want to send a VFS update after the copy. False otherwise (if you do a lot
 	 *                      of copy)
@@ -668,23 +668,35 @@ public abstract class VFS
 		throws IOException
 	{
 		VFS sourceVFS = VFSManager.getVFSForPath(sourcePath);
-		Object sourceSession = sourceVFS.createVFSSession(sourcePath, comp);
-		if (sourceSession == null)
+		VFS targetVFS = VFSManager.getVFSForPath(targetPath);
+		Object sourceSession = null;
+		Object targetSession = null;
+		try
 		{
-			Log.log(Log.WARNING, VFS.class, "Unable to get a valid session from " + sourceVFS +
-							" for path " + sourcePath);
-			return false;
+			sourceSession = sourceVFS.createVFSSession(sourcePath, comp);
+			if (sourceSession == null)
+			{
+				Log.log(Log.WARNING, VFS.class, "Unable to get a valid session from " + sourceVFS +
+												" for path " + sourcePath);
+				return false;
+			}
+			targetSession = targetVFS.createVFSSession(targetPath, comp);
+			if (targetSession == null)
+			{
+				Log.log(Log.WARNING, VFS.class, "Unable to get a valid session from " + targetVFS +
+												" for path " + targetPath);
+				return false;
+			}
+			return copy(progress, sourceVFS, sourceSession, sourcePath, targetVFS, targetSession, targetPath,
+						comp,canStop, sendVFSUpdate);
 		}
-		VFS targetVFS = VFSManager.getVFSForPath(targetPath);
-		Object targetSession = targetVFS.createVFSSession(targetPath, comp);
-		if (targetSession == null)
+		finally
 		{
-			Log.log(Log.WARNING, VFS.class, "Unable to get a valid session from " + targetVFS +
-							" for path " + targetPath);
-			return false;
+			if (sourceSession != null)
+				sourceVFS._endVFSSession(sourceSession, comp);
+			if (targetSession != null)
+				targetVFS._endVFSSession(targetSession, comp);
 		}
-		return copy(progress, sourceVFS, sourceSession, sourcePath, targetVFS, targetSession, targetPath,
-			    comp,canStop, sendVFSUpdate);
 	}
 
 	/**
@@ -694,7 +706,7 @@ public abstract class VFS
 	 *                  you should probably launch this command in a WorkThread
 	 * @param sourcePath the source path
 	 * @param targetPath the target path
-	 * @param comp comp The component that will parent error dialog boxes
+	 * @param comp The component that will parent error dialog boxes
 	 * @param canStop if true the copy can be stopped
 	 * @return true if the copy was successful
 	 * @throws IOException IOException If an I/O error occurs
@@ -726,7 +738,7 @@ public abstract class VFS
 		if(session == null)
 			return false;
 
-		VFSManager.runInWorkThread(new BufferInsertRequest(
+		ThreadUtilities.runInBackground(new BufferInsertRequest(
 			view,buffer,session,this,path));
 		return true;
 	} //}}}
@@ -751,7 +763,7 @@ public abstract class VFS
 
 	//{{{ _listDirectory() method
 	/**
-	 * A convinience method that matches file names against globs, and can
+	 * A convenience method that matches file names against globs, and can
 	 * optionally list the directory recursively.
 	 * @param session The session
 	 * @param directory The directory. Note that this must be a full
@@ -934,7 +946,7 @@ public abstract class VFS
 	/**
 	 * Backs up the specified file. Default implementation in 5.0pre1
 	 * copies the file to the backup directory. Before 5.0pre1 it was
-	 * empty. 
+	 * empty.
 	 * @param session The VFS session
 	 * @param path The path
 	 * @param comp The component that will parent error dialog boxes
@@ -963,7 +975,7 @@ public abstract class VFS
 		{
 			// Usually that means there is no specified backup
 			// directory.
-			Log.log(Log.WARNING, VFS.class, "Backup of file " + 
+			Log.log(Log.WARNING, VFS.class, "Backup of file " +
 				path + " failed. Directory " + backupDir +
 				" does not exist.");
 			return;
@@ -974,7 +986,7 @@ public abstract class VFS
 		{
 			return;
 		}
-		
+
 		// do copy using VFS.copy
 		VFS vfsDst = VFSManager.getVFSForPath(backupFile.getPath());
 		Object sessionDst = vfsDst.createVFSSessionSafe(
@@ -989,7 +1001,7 @@ public abstract class VFS
 				vfsDst, sessionDst, backupFile.getPath(),
 				comp, true))
 			{
-				Log.log(Log.WARNING, VFS.class, "Backup of file " + 
+				Log.log(Log.WARNING, VFS.class, "Backup of file " +
 					path + " failed. Copy to " + backupFile +
 					" failed.");
 			}
@@ -998,7 +1010,7 @@ public abstract class VFS
 		{
 			vfsDst._endVFSSession(sessionDst, comp);
 		}
-		
+
 	} //}}}
 
 	//{{{ _createInputStream() method
@@ -1200,14 +1212,6 @@ public abstract class VFS
 			}
 		}
 
-		Thread ct = Thread.currentThread();
-		WorkThread wt = null;
-		if (ct instanceof WorkThread)
-		{
-			wt = (WorkThread) ct;
-		}
-
-
 		VFSFile[] _files = _listFiles(session,directory,
 			comp);
 		if(_files == null || _files.length == 0)
@@ -1215,7 +1219,7 @@ public abstract class VFS
 
 		for(int i = 0; i < _files.length; i++)
 		{
-			if (wt != null && wt.isAborted() || ct.isInterrupted())
+			if (Thread.currentThread().isInterrupted())
 				break;
 			VFSFile file = _files[i];
 			if (skipHidden && (file.isHidden() || MiscUtilities.isBackup(file.getName())))
@@ -1316,12 +1320,12 @@ public abstract class VFS
 		private Object session;
 		private String path;
 		private Component comp;
-		
+
 		public void run()
 		{
 			session = createVFSSession(path, comp);
 		}
-		
+
 		public Object get() { return session; }
 	} //}}}
 
diff --git a/org/gjt/sp/jedit/io/VFSFile.java b/org/gjt/sp/jedit/io/VFSFile.java
index 1e2fad0..7950fb2 100644
--- a/org/gjt/sp/jedit/io/VFSFile.java
+++ b/org/gjt/sp/jedit/io/VFSFile.java
@@ -1,6 +1,6 @@
 /*
  * VFSFile.java - A file residing on a virtual file system
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2005 Slava Pestov
@@ -26,6 +26,8 @@ package org.gjt.sp.jedit.io;
 //{{{ Imports
 import java.awt.Color;
 import java.io.*;
+import java.io.Closeable;
+
 import org.gjt.sp.jedit.*;
 import org.gjt.sp.jedit.browser.VFSBrowser;
 import org.gjt.sp.jedit.browser.FileCellRenderer;
@@ -125,7 +127,7 @@ public class VFSFile implements Serializable
 				VFSManager.error(e,path,browser);
 			}
 		}
-		
+
 		return null;
 	} //}}}
 
@@ -144,7 +146,7 @@ public class VFSFile implements Serializable
 	/**
 	 * Returns the icon for the file.
 	 * Implementations of File system browsers can override this method
-	 *  
+	 *
 	 * @since jEdit 4.3pre9
 	 */
 	public Icon getIcon(boolean expanded, boolean openBuffer)
@@ -236,7 +238,7 @@ public class VFSFile implements Serializable
 	{
 		return VFSManager.getVFSForPath(path);
 	} //}}}
-	
+
 	//{{{ getName() method
 	public String getName()
 	{
@@ -272,7 +274,7 @@ public class VFSFile implements Serializable
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(in);
+			IOUtilities.closeQuietly((Closeable)in);
 		}
 	} //}}}
 
@@ -450,7 +452,7 @@ public class VFSFile implements Serializable
 	{
 		return name;
 	} //}}}
-	
+
 	//{{{ fetchedAttrs() method
 	/**
 	 * Returns true if the attributes are already fetched.
@@ -462,7 +464,7 @@ public class VFSFile implements Serializable
 	{
 		return fetchedAttrs;
 	} //}}}
-	
+
 	//{{{ fetchAttrs() method
 	/**
 	 * Fetch some attributes of the file.
diff --git a/org/gjt/sp/jedit/io/VFSManager.java b/org/gjt/sp/jedit/io/VFSManager.java
index 79bb358..97a1cd8 100644
--- a/org/gjt/sp/jedit/io/VFSManager.java
+++ b/org/gjt/sp/jedit/io/VFSManager.java
@@ -31,12 +31,15 @@ import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.util.*;
 
+import org.gjt.sp.jedit.bufferio.IoTask;
 import org.gjt.sp.jedit.gui.ErrorListDialog;
 import org.gjt.sp.jedit.msg.VFSUpdate;
 import org.gjt.sp.jedit.*;
 import org.gjt.sp.util.Log;
+import org.gjt.sp.util.Task;
+import org.gjt.sp.util.TaskManager;
 import org.gjt.sp.util.ThreadUtilities;
-import org.gjt.sp.util.WorkThreadPool;
+import org.gjt.sp.util.AwtRunnableQueue;
 import org.gjt.sp.util.StandardUtilities;
 //}}}
 
@@ -52,7 +55,7 @@ import org.gjt.sp.util.StandardUtilities;
  * {@link #waitForRequests()}.
  *
  * @author Slava Pestov
- * @version $Id: VFSManager.java 22134 2012-09-02 02:22:53Z ezust $
+ * @version $Id: VFSManager.java 22943 2013-04-22 11:44:40Z thomasmey $
  */
 public class VFSManager
 {
@@ -68,13 +71,6 @@ public class VFSManager
 	 */
 	public static void init()
 	{
-		int count = jEdit.getIntegerProperty("ioThreadCount",4);
-		ioThreadPool = new WorkThreadPool("jEdit I/O",count);
-		JARClassLoader classLoader = new JARClassLoader();
-		for(int i = 0; i < ioThreadPool.getThreadCount(); i++)
-		{
-			ioThreadPool.getThread(i).setContextClassLoader(classLoader);
-		}
 	} //}}}
 
 	//{{{ start() method
@@ -83,7 +79,7 @@ public class VFSManager
 	 */
 	public static void start()
 	{
-		ioThreadPool.start();
+		AwtRunnableQueue.INSTANCE.start();
 	} //}}}
 
 	//{{{ VFS methods
@@ -168,23 +164,18 @@ public class VFSManager
 
 	//{{{ I/O request methods
 
-	//{{{ getIOThreadPool() method
-	/**
-	 * Returns the I/O thread pool.
-	 */
-	public static WorkThreadPool getIOThreadPool()
-	{
-		return ioThreadPool;
-	} //}}}
-
 	//{{{ waitForRequests() method
 	/**
 	 * Returns when all pending requests are complete.
+	 * Must be called in the Event Dispatch Thread
 	 * @since jEdit 2.5pre1
 	 */
 	public static void waitForRequests()
 	{
-		ioThreadPool.waitForRequests();
+		if(EventQueue.isDispatchThread() != true)
+			throw new IllegalStateException();
+
+		TaskManager.instance.waitForIoTasks();
 	} //}}}
 
 	//{{{ errorOccurred() method
@@ -202,7 +193,7 @@ public class VFSManager
 	 */
 	public static int getRequestCount()
 	{
-		return ioThreadPool.getRequestCount();
+		return TaskManager.instance.countIoTasks();
 	} //}}}
 
 	//{{{ runInAWTThread() method
@@ -223,7 +214,7 @@ public class VFSManager
 	@Deprecated
 	public static void runInAWTThread(Runnable run)
 	{
-		ioThreadPool.addWorkRequest(run,true);
+		AwtRunnableQueue.INSTANCE.runAfterIoTasks(run);
 	} //}}}
 
 	//{{{ runInWorkThread() method
@@ -236,9 +227,12 @@ public class VFSManager
 	 * @see org.gjt.sp.util.ThreadUtilities#runInBackground(Runnable)
 	 */
 	@Deprecated
-	public static void runInWorkThread(Runnable run)
+	public static void runInWorkThread(Task run)
 	{
-		ioThreadPool.addWorkRequest(run,false);
+		if(!(run instanceof IoTask))
+			throw new IllegalArgumentException();
+
+		ThreadUtilities.runInBackground(run);
 	} //}}}
 
 	//}}}
@@ -348,7 +342,7 @@ public class VFSManager
 					// we were the first to add an update;
 					// add update sending runnable to AWT
 					// thread
-					VFSManager.runInAWTThread(new SendVFSUpdatesSafely());
+					AwtRunnableQueue.INSTANCE.runAfterIoTasks(new SendVFSUpdatesSafely());
 				}
 			}
 		}
@@ -382,7 +376,6 @@ public class VFSManager
 	//{{{ Private members
 
 	//{{{ Static variables
-	private static WorkThreadPool ioThreadPool;
 	private static VFS fileVFS;
 	private static VFS urlVFS;
 	private static boolean error;
@@ -500,7 +493,7 @@ public class VFSManager
 				Vector<ErrorListDialog.ErrorEntry> errorsCopy;
 				synchronized(errorLock)
 				{
-					errorsCopy = new Vector(errors);
+					errorsCopy = new Vector<ErrorListDialog.ErrorEntry>(errors);
 					errors.clear();
 					error = false;
 				}
diff --git a/org/gjt/sp/jedit/io/XMLEncodingDetector.java b/org/gjt/sp/jedit/io/XMLEncodingDetector.java
index 0fadab7..6015468 100644
--- a/org/gjt/sp/jedit/io/XMLEncodingDetector.java
+++ b/org/gjt/sp/jedit/io/XMLEncodingDetector.java
@@ -1,5 +1,5 @@
 /*
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2007 Kazutoshi Satoda
diff --git a/org/gjt/sp/jedit/jEdit.java b/org/gjt/sp/jedit/jEdit.java
index 4e3d1e6..6903a95 100644
--- a/org/gjt/sp/jedit/jEdit.java
+++ b/org/gjt/sp/jedit/jEdit.java
@@ -1,6 +1,6 @@
 /*
  * jEdit.java - Main class of the jEdit editor
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2005 Slava Pestov
@@ -22,10 +22,15 @@
 package org.gjt.sp.jedit;
 
 //{{{ Imports
+import java.io.Closeable;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+
 import org.gjt.sp.jedit.datatransfer.JEditTransferableService;
 import org.gjt.sp.jedit.gui.tray.JTrayIconManager;
 import org.gjt.sp.util.StringList;
 import org.jedit.core.MigrationService;
+import org.jedit.migration.OneTimeMigrationService;
 import org.jedit.keymap.KeymapManager;
 import org.jedit.keymap.KeymapManagerImpl;
 import org.gjt.sp.jedit.visitors.JEditVisitor;
@@ -40,6 +45,7 @@ import javax.annotation.Nullable;
 import javax.swing.*;
 import java.awt.event.*;
 import java.io.*;
+import java.lang.reflect.Field;
 import java.net.*;
 import java.text.MessageFormat;
 import java.util.*;
@@ -65,8 +71,10 @@ import org.gjt.sp.jedit.textarea.*;
 import org.gjt.sp.jedit.visitors.SaveCaretInfoVisitor;
 import org.gjt.sp.jedit.bufferset.BufferSetManager;
 import org.gjt.sp.jedit.bufferset.BufferSet;
+import org.gjt.sp.util.AwtRunnableQueue;
 import org.gjt.sp.util.Log;
 import org.gjt.sp.util.StandardUtilities;
+import org.gjt.sp.util.TaskManager;
 import org.gjt.sp.util.XMLUtilities;
 import org.gjt.sp.util.IOUtilities;
 import org.gjt.sp.util.SyntaxUtilities;
@@ -75,7 +83,7 @@ import org.gjt.sp.util.SyntaxUtilities;
 /**
  * The main class of the jEdit text editor.
  * @author Slava Pestov
- * @version $Id: jEdit.java 22485 2012-11-17 15:40:15Z Vampire0 $
+ * @version $Id: jEdit.java 23090 2013-07-28 17:02:35Z Vampire0 $
  */
 public class jEdit
 {
@@ -96,7 +104,7 @@ public class jEdit
 	public static String getBuild()
 	{
 		// (major).(minor).(<99 = preX, 99 = "final").(bug fix)
-		return "05.00.99.00";
+		return "05.01.99.00";
 	} //}}}
 
 	//{{{ main() method
@@ -141,6 +149,23 @@ public class jEdit
 		// are closed
 		background = OperatingSystem.isMacOS();
 
+		// Fix X11 windows class
+		if (OperatingSystem.isX11())
+		{
+			try
+			{
+				Toolkit xToolkit = Toolkit.getDefaultToolkit();
+				Field awtAppClassNameField =
+					xToolkit.getClass().getDeclaredField("awtAppClassName");
+				awtAppClassNameField.setAccessible(true);
+				awtAppClassNameField.set(xToolkit, System.getProperty("x11.wmclass", "jedit"));
+			}
+			catch (Exception e)
+			{
+				Log.log(Log.ERROR, jEdit.class, e);
+			}
+		}
+
 		//{{{ Parse command line
 		boolean endOpts = false;
 		int level = Log.WARNING;
@@ -275,19 +300,22 @@ public class jEdit
 		//{{{ Try connecting to another running jEdit instance
 		if(portFile != null && new File(portFile).exists())
 		{
+			BufferedReader in = null;
+			DataOutputStream out = null;
 			try
 			{
-				BufferedReader in = new BufferedReader(new FileReader(portFile));
+				in = new BufferedReader(new FileReader(portFile));
 				String check = in.readLine();
 				if(!"b".equals(check))
-					throw new Exception("Wrong port file format");
+					throw new IllegalArgumentException("Wrong port file format");
 
 				int port = Integer.parseInt(in.readLine());
 				int key = Integer.parseInt(in.readLine());
 
-				Socket socket = new Socket(InetAddress.getByName("127.0.0.1"),port);
-				DataOutputStream out = new DataOutputStream(
-					socket.getOutputStream());
+				// socket is closed via BeanShell script below
+				@SuppressWarnings("resource")
+				Socket socket = new Socket(InetAddress.getByName(null),port);
+				out = new DataOutputStream(socket.getOutputStream());
 				out.writeInt(key);
 
 				String script;
@@ -306,17 +334,9 @@ public class jEdit
 				out.writeUTF(script);
 
 				Log.log(Log.DEBUG,jEdit.class,"Waiting for server");
-				// block until its closed
-				try
-				{
-					socket.getInputStream().read();
-				}
-				catch(Exception e)
-				{
-				}
 
-				in.close();
-				out.close();
+				// block until its closed
+				socket.getInputStream().read();
 
 				System.exit(0);
 			}
@@ -334,6 +354,22 @@ public class jEdit
 					+ " know what this means, don't worry.");
 				Log.log(Log.NOTICE,jEdit.class,e);
 			}
+			finally
+			{
+				if(in != null)
+					try
+					{
+						in.close();
+					}
+					catch (IOException e) {}
+
+				if(out != null)
+					try
+					{
+						out.close();
+					}
+					catch (IOException e) {}
+			}
 		}
 
 		if(quit)
@@ -357,7 +393,6 @@ public class jEdit
 		if(splash && (!new File(settingsDirectory,"nosplash").exists()))
 			GUIUtilities.showSplashScreen();
 		logTime("after splash screen activation");
-
 		//{{{ Settings migration code.
 		// Windows check introduced in 5.0pre1.
 		// MacOS check introduced in 4.3.
@@ -498,6 +533,10 @@ public class jEdit
 		KillRing.setInstance(new JEditKillRing());
 		KillRing.getInstance().load();
 		GUIUtilities.advanceSplashProgress("init various properties");
+
+		// other one-time migration services.
+		OneTimeMigrationService.execute();
+
 		propertiesChanged();
 
 		GUIUtilities.advanceSplashProgress("init modes");
@@ -1017,6 +1056,7 @@ public class jEdit
 		HistoryModel.setDefaultMaxSize(getIntegerProperty("historyMaxSize", 5000000));
 		KillRing.getInstance().propertiesChanged(getIntegerProperty("history",25));
 		Chunk.propertiesChanged(propertyManager);
+		Log.setBeepOnOutput(jEdit.getBooleanProperty("debug.beepOnOutput"));
 
 		if (getBooleanProperty("systrayicon"))
 		{
@@ -1028,7 +1068,7 @@ public class jEdit
 		}
 		EditBus.send(new PropertiesChanged(null));
 	} //}}}
-	
+
 	//}}} Property methods fold end
 
 	//{{{ Plugin management methods
@@ -1092,23 +1132,30 @@ public class jEdit
 	 */
 	public static EditPlugin getPlugin(String name, boolean loadIfNecessary)
 	{
+		if (name == null)
+		{
+			return null;	
+		}
+		
 		EditPlugin[] plugins = getPlugins();
 		EditPlugin plugin = null;
-		for(int i = 0; i < plugins.length; i++)
+		for (EditPlugin ep : plugins)
 		{
-			if(plugins[i].getClassName().equals(name))
-				plugin = plugins[i];
-			if(loadIfNecessary)
+			if (ep.getClassName().equals(name))
 			{
-				if(plugin instanceof EditPlugin.Deferred)
-				{
-					plugin.getPluginJAR().activatePlugin();
-					plugin = plugin.getPluginJAR().getPlugin();
-					break;
-				}
+				plugin = ep;
+				break;
 			}
 		}
-		if (!loadIfNecessary) return plugin;
+		if (!loadIfNecessary) 
+		{
+			return plugin;	
+		}
+		if (plugin instanceof EditPlugin.Deferred)
+		{
+			plugin.getPluginJAR().activatePlugin();
+			plugin = plugin.getPluginJAR().getPlugin();
+		}
 		String jarPath = PluginJAR.findPlugin(name);
 		PluginJAR pjar = PluginJAR.load(jarPath, true);
 		return pjar.getPlugin();
@@ -1187,7 +1234,9 @@ public class jEdit
 		jars.addElement(jar);
 		if (jar.init())
 		{
-			jEdit.unsetProperty("plugin-blacklist."+MiscUtilities.getFileName(path));
+			String jarName = MiscUtilities.getFileName(path);
+			jEdit.unsetProperty("plugin-blacklist."+jarName);
+			jEdit.unsetProperty("plugin." + jarName + ".disabled");
 			EditBus.send(new PluginUpdate(jar,PluginUpdate.LOADED,false));
 			if(!isMainThread())
 			{
@@ -1408,7 +1457,7 @@ public class jEdit
 				}
 				finally
 				{
-					IOUtilities.closeQuietly(out);
+					IOUtilities.closeQuietly((Closeable)out);
 				}
 			}
 
@@ -1482,7 +1531,7 @@ public class jEdit
 		}
 
 		if(view != null && retVal != null)
-			view.setBuffer(retVal,true);
+			view.setBuffer(retVal);
 
 		return retVal;
 	} //}}}
@@ -1524,7 +1573,7 @@ public class jEdit
 	 */
 	public static Buffer openFile(View view, String path)
 	{
-		return openFile(view,null,path,false,new Hashtable());
+		return openFile(view,null,path,false,new Hashtable<String,Object>());
 	}
 
 	/**
@@ -1544,7 +1593,7 @@ public class jEdit
 	 * @since jEdit 3.2pre10
 	 */
 	public static Buffer openFile(View view, String parent,
-		String path, boolean newFile, Hashtable props)
+		String path, boolean newFile, Hashtable<String,Object> props)
 	{
 		return openFile(view == null ? null : view.getEditPane(), parent, path, newFile, props);
 	}
@@ -1561,7 +1610,7 @@ public class jEdit
 	 */
 	public static Buffer openFile(EditPane editPane, String path)
 	{
-		return openFile(editPane,null,path,false,new Hashtable());
+		return openFile(editPane,null,path,false,new Hashtable<String,Object>());
 	}
 
 	/**
@@ -1579,7 +1628,7 @@ public class jEdit
 	 * @since jEdit 4.3pre17
 	 */
 	public static Buffer openFile(EditPane editPane, String parent,
-		String path, boolean newFile, Hashtable props)
+		String path, boolean newFile, Hashtable<String,Object> props)
 	{
 		PerspectiveManager.setPerspectiveDirty(true);
 
@@ -1590,16 +1639,22 @@ public class jEdit
 		{
 			URL u = new URL(path);
 			if ("file".equals(u.getProtocol()))
-				path = URLDecoder.decode(u.getPath());
+			{
+				path = URLDecoder.decode(u.getPath(), "UTF-8");
+			}
 		}
-		catch (MalformedURLException mue)
+		catch(UnsupportedEncodingException e)
+		{
+			path = MiscUtilities.constructPath(parent,path);
+		}
+		catch (MalformedURLException e)
 		{
 			path = MiscUtilities.constructPath(parent,path);
 		}
 
 
 		if(props == null)
-			props = new Hashtable();
+			props = new Hashtable<String,Object>();
 		composeBufferPropsFromHistory(props, path);
 
 		Buffer newBuffer;
@@ -1678,7 +1733,7 @@ public class jEdit
 	 * @since jEdit 4.3pre10
 	 */
 	public static Buffer openTemporary(View view, String parent,
-		String path, boolean newFile, Hashtable props)
+		String path, boolean newFile, Hashtable<String, Object> props)
 	{
 		if(view != null && parent == null)
 			parent = view.getBuffer().getDirectory();
@@ -1692,7 +1747,7 @@ public class jEdit
 		path = MiscUtilities.constructPath(parent,path);
 
 		if(props == null)
-			props = new Hashtable();
+			props = new Hashtable<String, Object>();
 		composeBufferPropsFromHistory(props, path);
 
 		synchronized(bufferListLock)
@@ -1867,7 +1922,7 @@ public class jEdit
 		// Wait for pending I/O requests
 		if(buffer.isPerformingIO())
 		{
-			VFSManager.waitForRequests();
+			TaskManager.instance.waitForIoTasks();
 			if(VFSManager.errorOccurred())
 				return false;
 		}
@@ -1883,7 +1938,7 @@ public class jEdit
 				if(!buffer.save(view,null,true))
 					return false;
 
-				VFSManager.waitForRequests();
+				TaskManager.instance.waitForIoTasks();
 				if(buffer.getBooleanProperty(BufferIORequest
 					.ERROR_OCCURRED))
 				{
@@ -1972,6 +2027,13 @@ public class jEdit
 			return;
 		}
 
+		// in case of a temporary buffer, just close it
+		if(buffer.isTemporary())
+		{
+			buffer.close();
+			return;
+		}
+
 		PerspectiveManager.setPerspectiveDirty(true);
 
 		if(!buffer.isNewFile())
@@ -1987,15 +2049,19 @@ public class jEdit
 				buffer.getMode().getName());
 		}
 
+		EditBus.send(new BufferUpdate(buffer,view,BufferUpdate.CLOSING));
+
+		//FIXME: Duplicate code? Same is done in removeBufferFromList(buffer);
 		String path = buffer.getSymlinkPath();
 		if((VFSManager.getVFSForPath(path).getCapabilities()
 			& VFS.CASE_INSENSITIVE_CAP) != 0)
 		{
 			path = path.toLowerCase();
 		}
-		EditBus.send(new BufferUpdate(buffer,view,BufferUpdate.CLOSING));
 		bufferHash.remove(path);
+
 		removeBufferFromList(buffer);
+
 		buffer.close();
 		DisplayManager.bufferClosed(buffer);
 		bufferSetManager.removeBuffer(buffer);
@@ -2051,7 +2117,7 @@ public class jEdit
 		}
 
 		// Wait for pending I/O requests
-		VFSManager.waitForRequests();
+		TaskManager.instance.waitForIoTasks();
 		if(VFSManager.errorOccurred())
 			return false;
 
@@ -2132,14 +2198,14 @@ public class jEdit
 			if(buffer.isDirty())
 			{
 				if(buffer.isNewFile())
-					view.setBuffer(buffer,true);
+					view.setBuffer(buffer);
 				buffer.save(view,null,true,true);
 			}
 
 			buffer = buffer.next;
 		}
 
-		view.setBuffer(current,true);
+		view.setBuffer(current);
 	} //}}}
 
 	//{{{ reloadAllBuffers() method
@@ -2232,8 +2298,9 @@ public class jEdit
 
 	//{{{ getBuffers() method
 	/**
-	 * Returns an array of open buffers.
+	 * Returns an array of all open buffers from any View.
 	 * @return  an array of all open buffers
+	 * @see View#getBuffers()
 	 */
 	public static Buffer[] getBuffers()
 	{
@@ -2334,6 +2401,9 @@ public class jEdit
 	 */
 	public static void checkBufferStatus(View view, boolean currentBuffer)
 	{
+		Log.log(Log.DEBUG, jEdit.class, "checkBufferStatus for " +
+			(currentBuffer ? "current buffer: " + view.getBuffer() : "all buffers"));
+
 		// still need to call the status check even if the option is
 		// off, so that the write protection is updated if it changes
 		// on disk
@@ -2487,11 +2557,10 @@ public class jEdit
 			View newView = new View(buffer,config);
 			addViewToList(newView);
 
-			newView.pack();
-			newView.adjust(view, config);
-
 			EditBus.send(new ViewUpdate(newView,ViewUpdate.CREATED));
 
+			newView.pack();
+			newView.adjust(view, config);
 			newView.setVisible(true);
 
 			if(!config.plainView)
@@ -2713,7 +2782,7 @@ public class jEdit
 	 * blindly use this method without checking for a <code>null</code>
 	 * return value first. <p>
 	 *
-	 * <b>NOTE</b>: plugins should <b>not</b> use this directory as a base to 
+	 * <b>NOTE</b>: plugins should <b>not</b> use this directory as a base to
 	 * store their files. Instead, they should use EditPlugin.getPluginHome().
 	 * @see EditPlugin#getPluginHome()
 	 */
@@ -2799,7 +2868,7 @@ public class jEdit
 			}
 			finally
 			{
-				IOUtilities.closeQuietly(out);
+				IOUtilities.closeQuietly((Closeable)out);
 			}
 			file2.delete();
 			if (! file1.renameTo(file2))
@@ -2827,7 +2896,7 @@ public class jEdit
 			view = activeView;
 
 		// Wait for pending I/O requests
-		VFSManager.waitForRequests();
+		TaskManager.instance.waitForIoTasks();
 
 		// Create a new EditorExitRequested
 		EditorExitRequested eer = new EditorExitRequested(view);
@@ -3071,6 +3140,18 @@ public class jEdit
 		propMgr.removePluginProps(map);
 	} //}}}
 
+	//{{{ addPluginLocalizationProps() method
+	static void addPluginLocalizationProps(Properties map)
+	{
+		propMgr.addPluginLocalizationProps(map);
+	} //}}}
+
+	//{{{ removePluginLocalizationProps() method
+	static void removePluginLocalizationProps(Properties map)
+	{
+		propMgr.removePluginLocalizationProps(map);
+	} //}}}
+
 	//{{{ pluginError() method
 	/**
 	 * @param path
@@ -3670,7 +3751,7 @@ public class jEdit
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(langResource);
+			IOUtilities.closeQuietly((Closeable)langResource);
 		}
 	} //}}}
 
@@ -3710,7 +3791,7 @@ public class jEdit
 		String sLfNew = null;
 		LookAndFeel lfOld = UIManager.getLookAndFeel();
 		if (lfOld != null)
-			sLfOld = lfOld.getClass().getName(); 
+			sLfOld = lfOld.getClass().getName();
 
 		// do not change anything if Look and Feel did not change
 		if (isStartupDone() && getPLAFClassName(lf).equals(sLfOld))
@@ -3760,6 +3841,13 @@ public class jEdit
 
 		try
 		{
+			// A couple of issues here --
+			// First, setLookAndFeel must be called on the EDT. On initial start
+			// up this isn't a problem, but initPLAF is called on propertiesChanged,
+			// which can happen a lot.
+			// Second, this will fail to load the look and feel as set in the
+			// LookAndFeel plugin on initial start up because the plugins haven't
+			// been loaded yet.
 			UIManager.setLookAndFeel(getPLAFClassName(lf));
 		}
 		catch(Exception e)
@@ -3775,11 +3863,11 @@ public class jEdit
 				(EventQueue.isDispatchThread() ? "edt"
 				                               : "non-edt") +
 				" old=" + sLfOld +
-				" requested=" + lf + 
+				" requested=" + lf +
 				" new=" + sLfNew );
 		if (lf == null || !lf.equals(sLfNew))
 			Log.log(Log.WARNING, jEdit.class,
-				"inifPLAF failed to set required l&f");
+				"initPLAF failed to set required l&f");
 
 		UIDefaults defaults = UIManager.getDefaults();
 
@@ -4086,7 +4174,8 @@ public class jEdit
 					}
 
 					if(buffer != null)
-						view.setBuffer(buffer,true);
+						view.setBuffer(buffer);
+					view.toFront();
 				}
 				else
 				{
@@ -4106,7 +4195,7 @@ public class jEdit
 
 				Log.log(Log.MESSAGE,jEdit.class,"Startup "
 					+ "complete: "
-					+ (System.currentTimeMillis() - 
+					+ (System.currentTimeMillis() -
 					   startupTime) + " ms");
 
 				//{{{ Report any plugin errors
@@ -4147,10 +4236,10 @@ public class jEdit
 	} //}}}
 
 	//{{{ getNotLoadedPluginJARs() method
-	private static void getNotLoadedPluginJARs(List<String> returnValue,
+	private static void getNotLoadedPluginJARs(Collection<String> returnValue,
 		String dir, String[] list)
 	{
-loop:		for(int i = 0; i < list.length; i++)
+loop:	for(int i = 0; i < list.length; i++)
 		{
 			String name = list[i];
 			if(!name.toLowerCase().endsWith(".jar"))
@@ -4162,12 +4251,10 @@ loop:		for(int i = 0; i < list.length; i++)
 			{
 				PluginJAR jar = jars.elementAt(j);
 				String jarPath = jar.getPath();
-				String jarName = MiscUtilities.getFileName(jarPath);
 
-				if(path.equals(jarPath))
-					continue loop;
-				else if(!new File(jarPath).exists()
-					&& name.equals(jarName))
+				if (path.equals(jarPath) ||
+					name.equals(MiscUtilities.getFileName(jarPath)) &&
+					!new File(jarPath).exists())
 					continue loop;
 			}
 
@@ -4179,7 +4266,7 @@ loop:		for(int i = 0; i < list.length; i++)
 	private static void gotoMarker(final View view, final Buffer buffer,
 		final String marker)
 	{
-		VFSManager.runInAWTThread(new Runnable()
+		AwtRunnableQueue.INSTANCE.runAfterIoTasks(new Runnable()
 		{
 			@Override
 			public void run()
@@ -4498,7 +4585,7 @@ loop:		for(int i = 0; i < list.length; i++)
 	 * Compose buffer-local properties which can be got from history.
 	 * @since 4.3pre10
 	 */
-	private static void composeBufferPropsFromHistory(Map props, String path)
+	private static void composeBufferPropsFromHistory(Map<String, Object> props, String path)
 	{
 		BufferHistory.Entry entry = BufferHistory.getEntry(path);
 
diff --git a/org/gjt/sp/jedit/jedit.props b/org/gjt/sp/jedit/jedit.props
index 9b1cf2f..2a18511 100644
--- a/org/gjt/sp/jedit/jedit.props
+++ b/org/gjt/sp/jedit/jedit.props
@@ -128,8 +128,8 @@ autoReloadDialog=true
 # If this is true, auto reload; if false, use 'reload' button in dialog
 autoReload=true
 
-# When to check file status on disk (0 = upon app focus; 1 = upon app focus, visiting the buffer or saving any buffer; 2 = upon visiting the buffer or saving any buffer; 3 = visiting the buffer; 4 = upon saving the buffer)
-checkFileStatus=0
+# When to check file status on disk: 1=view focus. See GeneralOptionPane class for meanings of values.
+checkFileStatus=1
 
 # Encoding detectors
 encodingDetectors=BOM XML-PI html python buffer-local-property
@@ -267,6 +267,9 @@ view.electricBorders=3
 # Drag and drop of text
 view.dragAndDrop=true
 
+# Abbreviate paths using environment variables
+view.abbreviatePaths=true
+
 # Treat consecutive non-alphanumeric characters as one word
 view.joinNonWordChars=true
 
@@ -399,7 +402,8 @@ view.fracFontMetrics=false
 
 # Docking and tool bar positioning
 view.docking.alternateLayout=false
-view.toolbar.alternateLayout=false
+# "alternate" is actually closer to standard location IMHO...
+view.toolbar.alternateLayout=true
 
 #{{{ Status bar
 view.status.foreground=black
@@ -497,12 +501,16 @@ bufferSwitcher.maxRowCount=10
 showTooltips=true
 ioThreadCount=4
 server.brokenToFront=false
+search.dontSyncFilter=false
 #}}}
 
+#{{{ Miscellaneous settings
 # restore remote VFS files by default (new option)
 options.general.restore.remote=true
 optional.title-template={0} {1}
 mime2mode.text/html=html
+debug.beepOnOutput=false
+#}}}
 
 #{{{ Keymaps
 # the current keymap name
@@ -512,7 +520,7 @@ keymap.default=jEdit
 #}}}
 
 
-available.lang=en de fr ja cs ru
+available.lang=en de fr ja cs ru zh
 # if lang.usedefaultlocale is true, the lang.current is not used
 lang.usedefaultlocale=true
 lang.current=en
diff --git a/org/gjt/sp/jedit/jedit_gui.props b/org/gjt/sp/jedit/jedit_gui.props
index 1d5f4f6..7ef02ed 100644
--- a/org/gjt/sp/jedit/jedit_gui.props
+++ b/org/gjt/sp/jedit/jedit_gui.props
@@ -450,7 +450,7 @@ utils=vfs.browser \
       last-action \
       - \
       buffer-options \
-      combined-options \
+      global-options \
       - \
       %quick-options
 
@@ -592,6 +592,7 @@ about.text.contributors=Slava Pestov\n\
 	Chris Sullins\n\
 	Christoph Daniel Schulze\n\
 	Claude Eisenhut\n\
+	cnvince\n\
 	Cullen Linn\n\
 	Dakshinamurthy Karra\n\
 	Dale Anson\n\
@@ -710,6 +711,7 @@ about.text.contributors=Slava Pestov\n\
 	Rex Young\n\
 	Richard Ashwell\n\
 	Richard Beton\n\
+	Richard The\n\
 	Rick Gibbs\n\
 	Rick Owen\n\
 	Rob Watson\n\
@@ -815,6 +817,8 @@ options.appearance.lang.de=Deutsch
 options.appearance.lang.ja=日本語
 options.appearance.lang.cs=Česky
 options.appearance.lang.ru=Русский
+#Chinese
+options.appearance.lang.zh=中文
 #}}}
 
 #{{{ Context Menu pane
@@ -894,6 +898,9 @@ options.view.code=new ViewOptionPane();
 fullScreenIncludesMenu=true
 fullScreenIncludesToolbars=true
 fullScreenIncludesStatus=true
+
+# Enable subpixel antialiasing by default in textarea.
+view.antiAlias=subpixel HRGB
 #}}}
 
 #{{{ File System Browser panes
diff --git a/org/gjt/sp/jedit/menu/DirectoryProvider.java b/org/gjt/sp/jedit/menu/DirectoryProvider.java
index 126cb6a..43955a0 100644
--- a/org/gjt/sp/jedit/menu/DirectoryProvider.java
+++ b/org/gjt/sp/jedit/menu/DirectoryProvider.java
@@ -1,6 +1,6 @@
 /*
  * DirectoryProvider.java - File list menu
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2003 Slava Pestov
@@ -36,7 +36,7 @@ import org.gjt.sp.util.StandardUtilities;
 
 /**
  * @author Slava Pestov
- * @version $Id: DirectoryProvider.java 16207 2009-09-17 17:54:14Z shlomy $
+ * @version $Id: DirectoryProvider.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class DirectoryProvider implements DynamicMenuProvider
 {
diff --git a/org/gjt/sp/jedit/menu/DynamicMenuProvider.java b/org/gjt/sp/jedit/menu/DynamicMenuProvider.java
index 073a0ce..ee8ca4f 100644
--- a/org/gjt/sp/jedit/menu/DynamicMenuProvider.java
+++ b/org/gjt/sp/jedit/menu/DynamicMenuProvider.java
@@ -1,6 +1,6 @@
 /*
  * DynamicMenuProvider.java - API for dynamic plugin menus
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -32,7 +32,7 @@ import javax.swing.JMenu;
  *
  * @since jEdit 4.2pre2
  * @author Slava Pestov
- * @version $Id: DynamicMenuProvider.java 13060 2008-07-17 18:22:42Z ezust $
+ * @version $Id: DynamicMenuProvider.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public interface DynamicMenuProvider
 {
diff --git a/org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java b/org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java
index 83b338a..e2727b7 100644
--- a/org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java
+++ b/org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java
@@ -1,6 +1,6 @@
 /*
  * EnhancedCheckBoxMenuItem.java - Check box menu item
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/menu/EnhancedMenu.java b/org/gjt/sp/jedit/menu/EnhancedMenu.java
index 4335479..93a6c99 100644
--- a/org/gjt/sp/jedit/menu/EnhancedMenu.java
+++ b/org/gjt/sp/jedit/menu/EnhancedMenu.java
@@ -1,6 +1,6 @@
 /*
  * EnhancedMenu.java - jEdit menu
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/menu/EnhancedMenuItem.java b/org/gjt/sp/jedit/menu/EnhancedMenuItem.java
index d861770..9ac56e8 100644
--- a/org/gjt/sp/jedit/menu/EnhancedMenuItem.java
+++ b/org/gjt/sp/jedit/menu/EnhancedMenuItem.java
@@ -1,6 +1,6 @@
 /*
  * EnhancedMenuItem.java - Menu item with user-specified accelerator string
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/menu/FavoritesProvider.java b/org/gjt/sp/jedit/menu/FavoritesProvider.java
index a326dc5..bc74032 100644
--- a/org/gjt/sp/jedit/menu/FavoritesProvider.java
+++ b/org/gjt/sp/jedit/menu/FavoritesProvider.java
@@ -1,6 +1,6 @@
 /*
  * FavoritesProvider.java - Favorites list menu
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/menu/MacrosProvider.java b/org/gjt/sp/jedit/menu/MacrosProvider.java
index ac00768..71486ce 100644
--- a/org/gjt/sp/jedit/menu/MacrosProvider.java
+++ b/org/gjt/sp/jedit/menu/MacrosProvider.java
@@ -1,6 +1,6 @@
 /*
  * MacrosProvider.java - Macros menu
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/menu/MarkersProvider.java b/org/gjt/sp/jedit/menu/MarkersProvider.java
index 35686ae..05246c5 100644
--- a/org/gjt/sp/jedit/menu/MarkersProvider.java
+++ b/org/gjt/sp/jedit/menu/MarkersProvider.java
@@ -1,6 +1,6 @@
 /*
  * MarkersProvider.java - Markers menu
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/menu/MenuItemTextComparator.java b/org/gjt/sp/jedit/menu/MenuItemTextComparator.java
index d648d8d..98ed753 100644
--- a/org/gjt/sp/jedit/menu/MenuItemTextComparator.java
+++ b/org/gjt/sp/jedit/menu/MenuItemTextComparator.java
@@ -1,65 +1,65 @@
-/*
- * MenuItemTextComparator.java - Compares the text values of two JMenuItems
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2008 Eric Berry
- * Portions copyright (C) 1999, 2005 Slava Pestov
- * Portions copyright (C) 2000 Richard S. Hall
- * Portions copyright (C) 2001 Dirk Moebius
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.menu;
-
-//{{{ Imports
-import java.util.Comparator;
-
-import javax.swing.JMenuItem;
-
-import org.gjt.sp.util.StandardUtilities;
-
-//}}}
-/**
- * MenuItemTextComparator implements java.util.Comparator, and compares the text
- * value of JMenuItems using the case-insensitive smart comparison of
- * StandardUtilities.compareStrings. If one of the JMenuItems is an
- * EnhancedMenuItem it is given a higher comparison value.
- */
-public class MenuItemTextComparator implements Comparator<JMenuItem>
-{
-
-	// {{{ Compare Method.
-	public int compare(JMenuItem obj1, JMenuItem obj2)
-	{
-		int compareValue = 0;
-		boolean obj1E = obj1 instanceof EnhancedMenuItem;
-		boolean obj2E = obj2 instanceof EnhancedMenuItem;
-		if (obj1E && !obj2E)
-		{
-			compareValue = 1;
-		}
-		else if (obj2E && !obj1E)
-		{
-			compareValue = -1;
-		}
-		else
-		{
-			compareValue = StandardUtilities.compareStrings(obj1.getText(), obj2.getText(), true);
-		}
-		return compareValue;
-	} // }}}
-
-}
+/*
+ * MenuItemTextComparator.java - Compares the text values of two JMenuItems
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2008 Eric Berry
+ * Portions copyright (C) 1999, 2005 Slava Pestov
+ * Portions copyright (C) 2000 Richard S. Hall
+ * Portions copyright (C) 2001 Dirk Moebius
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.menu;
+
+//{{{ Imports
+import java.util.Comparator;
+
+import javax.swing.JMenuItem;
+
+import org.gjt.sp.util.StandardUtilities;
+
+//}}}
+/**
+ * MenuItemTextComparator implements java.util.Comparator, and compares the text
+ * value of JMenuItems using the case-insensitive smart comparison of
+ * StandardUtilities.compareStrings. If one of the JMenuItems is an
+ * EnhancedMenuItem it is given a higher comparison value.
+ */
+public class MenuItemTextComparator implements Comparator<JMenuItem>
+{
+
+	// {{{ Compare Method.
+	public int compare(JMenuItem obj1, JMenuItem obj2)
+	{
+		int compareValue = 0;
+		boolean obj1E = obj1 instanceof EnhancedMenuItem;
+		boolean obj2E = obj2 instanceof EnhancedMenuItem;
+		if (obj1E && !obj2E)
+		{
+			compareValue = 1;
+		}
+		else if (obj2E && !obj1E)
+		{
+			compareValue = -1;
+		}
+		else
+		{
+			compareValue = StandardUtilities.compareStrings(obj1.getText(), obj2.getText(), true);
+		}
+		return compareValue;
+	} // }}}
+
+}
diff --git a/org/gjt/sp/jedit/menu/PluginsProvider.java b/org/gjt/sp/jedit/menu/PluginsProvider.java
index 222fad4..1134d26 100644
--- a/org/gjt/sp/jedit/menu/PluginsProvider.java
+++ b/org/gjt/sp/jedit/menu/PluginsProvider.java
@@ -1,6 +1,6 @@
 /*
  * PluginsProvider.java - Plugins menu
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/menu/RecentDirectoriesProvider.java b/org/gjt/sp/jedit/menu/RecentDirectoriesProvider.java
index ed2f79f..0c1198a 100644
--- a/org/gjt/sp/jedit/menu/RecentDirectoriesProvider.java
+++ b/org/gjt/sp/jedit/menu/RecentDirectoriesProvider.java
@@ -1,6 +1,6 @@
 /*
  * RecentDirectoriesProvider.java - Recent directory list menu
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/menu/RecentFilesProvider.java b/org/gjt/sp/jedit/menu/RecentFilesProvider.java
index 687c32f..4d51851 100644
--- a/org/gjt/sp/jedit/menu/RecentFilesProvider.java
+++ b/org/gjt/sp/jedit/menu/RecentFilesProvider.java
@@ -1,6 +1,6 @@
 /*
  * RecentFilesProvider.java - Recent file list menu
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/menu/ReloadWithEncodingProvider.java b/org/gjt/sp/jedit/menu/ReloadWithEncodingProvider.java
index 348a812..e7e6aac 100644
--- a/org/gjt/sp/jedit/menu/ReloadWithEncodingProvider.java
+++ b/org/gjt/sp/jedit/menu/ReloadWithEncodingProvider.java
@@ -1,6 +1,6 @@
 /*
  * ReloadWithEncodingProvider.java - Recent file list menu
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Marcelo Vanzin
@@ -46,7 +46,7 @@ import org.gjt.sp.jedit.io.EncodingServer;
  * Menu provider for actions to reload the current buffer with a
  * specific encoding.
  *
- * @version $Id: ReloadWithEncodingProvider.java 20367 2011-11-17 22:29:08Z kpouer $
+ * @version $Id: ReloadWithEncodingProvider.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class ReloadWithEncodingProvider implements ActionListener, DynamicMenuProvider
 {	
diff --git a/org/gjt/sp/jedit/msg/BufferChanging.java b/org/gjt/sp/jedit/msg/BufferChanging.java
index 6d98e83..9b67c4a 100644
--- a/org/gjt/sp/jedit/msg/BufferChanging.java
+++ b/org/gjt/sp/jedit/msg/BufferChanging.java
@@ -1,6 +1,6 @@
 /*
  * BufferChanging.java - Buffer changing (specialized Edit Pane update message)
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Alan Ezust
@@ -35,7 +35,7 @@ import org.gjt.sp.util.Log;
  * Known plugins to be using this: BufferLocal, Navigator.
  * 
  * @since jEdit 4.3pre4
- * @version $Id: BufferChanging.java 16342 2009-10-14 10:07:18Z kpouer $
+ * @version $Id: BufferChanging.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class BufferChanging extends PositionChanging
 {
diff --git a/org/gjt/sp/jedit/msg/BufferUpdate.java b/org/gjt/sp/jedit/msg/BufferUpdate.java
index 813e307..6b258bf 100644
--- a/org/gjt/sp/jedit/msg/BufferUpdate.java
+++ b/org/gjt/sp/jedit/msg/BufferUpdate.java
@@ -1,6 +1,6 @@
 /*
  * BufferUpdate.java - Buffer update message
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2001 Slava Pestov
@@ -27,7 +27,7 @@ import org.gjt.sp.jedit.*;
 /**
  * Message sent when a buffer-related change occurs.
  * @author Slava Pestov
- * @version $Id: BufferUpdate.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: BufferUpdate.java 21831 2012-06-18 22:54:17Z ezust $
  *
  * @since jEdit 2.2pre6
  */
diff --git a/org/gjt/sp/jedit/msg/DockableWindowUpdate.java b/org/gjt/sp/jedit/msg/DockableWindowUpdate.java
index cf8a095..c706539 100644
--- a/org/gjt/sp/jedit/msg/DockableWindowUpdate.java
+++ b/org/gjt/sp/jedit/msg/DockableWindowUpdate.java
@@ -1,6 +1,6 @@
 /*
  * DockableWindowUpdate.java - Dockable window update message
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -28,7 +28,7 @@ import org.gjt.sp.jedit.*;
 /**
  * Message sent when dockable window state changes.
  * @author Slava Pestov
- * @version $Id: DockableWindowUpdate.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: DockableWindowUpdate.java 21831 2012-06-18 22:54:17Z ezust $
  *
  * @since jEdit 4.2pre1
  */
diff --git a/org/gjt/sp/jedit/msg/DynamicMenuChanged.java b/org/gjt/sp/jedit/msg/DynamicMenuChanged.java
index 03186b5..cf8bd35 100644
--- a/org/gjt/sp/jedit/msg/DynamicMenuChanged.java
+++ b/org/gjt/sp/jedit/msg/DynamicMenuChanged.java
@@ -1,7 +1,7 @@
 /*
  * DynamicMenuChanged.java - Message that causes dynamic menus to be
  * reconstructed
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -29,7 +29,7 @@ import org.gjt.sp.jedit.*;
  * Sending this message will cause the specified dynamic menu to be recreated.
  *
  * @author Slava Pestov
- * @version $Id: DynamicMenuChanged.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: DynamicMenuChanged.java 21831 2012-06-18 22:54:17Z ezust $
  *
  * @since jEdit 4.2pre2
  */
diff --git a/org/gjt/sp/jedit/msg/PluginUpdate.java b/org/gjt/sp/jedit/msg/PluginUpdate.java
index a61da52..19264bc 100644
--- a/org/gjt/sp/jedit/msg/PluginUpdate.java
+++ b/org/gjt/sp/jedit/msg/PluginUpdate.java
@@ -1,6 +1,6 @@
 /*
  * PluginUpdate.java - Plugin update message
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -27,7 +27,7 @@ import org.gjt.sp.jedit.*;
 /**
  * Message sent when plugins are loaded and unloaded.
  * @author Slava Pestov
- * @version $Id: PluginUpdate.java 17313 2010-02-17 22:32:09Z kpouer $
+ * @version $Id: PluginUpdate.java 21831 2012-06-18 22:54:17Z ezust $
  *
  * @since jEdit 4.2pre1
  */
diff --git a/org/gjt/sp/jedit/msg/PositionChanging.java b/org/gjt/sp/jedit/msg/PositionChanging.java
index 0e9210c..ef6728a 100644
--- a/org/gjt/sp/jedit/msg/PositionChanging.java
+++ b/org/gjt/sp/jedit/msg/PositionChanging.java
@@ -1,3 +1,25 @@
+/*
+ * PositionChanging.java - Cursor position changing (specialized Edit Pane update message)
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2006 Alan Ezust
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+ 
 package org.gjt.sp.jedit.msg;
 
 import org.gjt.sp.jedit.EditPane;
diff --git a/org/gjt/sp/jedit/msg/ViewUpdate.java b/org/gjt/sp/jedit/msg/ViewUpdate.java
index 405f7cf..17aa5ca 100644
--- a/org/gjt/sp/jedit/msg/ViewUpdate.java
+++ b/org/gjt/sp/jedit/msg/ViewUpdate.java
@@ -1,6 +1,6 @@
 /*
  * ViewUpdate.java - View update message
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2000, 2001, 2002 Slava Pestov
@@ -27,7 +27,7 @@ import org.gjt.sp.jedit.*;
 /**
  * Message sent when a view-related change occurs.
  * @author Slava Pestov
- * @version $Id: ViewUpdate.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: ViewUpdate.java 21831 2012-06-18 22:54:17Z ezust $
  *
  * @since jEdit 2.2pre6
  */
diff --git a/org/gjt/sp/jedit/options/AbbrevsOptionPane.java b/org/gjt/sp/jedit/options/AbbrevsOptionPane.java
index f2fc00d..fd56c6c 100644
--- a/org/gjt/sp/jedit/options/AbbrevsOptionPane.java
+++ b/org/gjt/sp/jedit/options/AbbrevsOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * AbbrevsOptionPane.java - Abbrevs options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2000, 2001, 2002 Slava Pestov
@@ -41,7 +41,7 @@ import org.gjt.sp.util.StandardUtilities;
 /**
  * Abbrev editor.
  * @author Slava Pestov
- * @version $Id: AbbrevsOptionPane.java 20328 2011-11-13 05:59:59Z ezust $
+ * @version $Id: AbbrevsOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class AbbrevsOptionPane extends AbstractOptionPane
 {
diff --git a/org/gjt/sp/jedit/options/AppearanceOptionPane.java b/org/gjt/sp/jedit/options/AppearanceOptionPane.java
index 49a1e2e..ce41c25 100644
--- a/org/gjt/sp/jedit/options/AppearanceOptionPane.java
+++ b/org/gjt/sp/jedit/options/AppearanceOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * AppearanceOptionPane.java - Appearance options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2004 Slava Pestov
diff --git a/org/gjt/sp/jedit/options/BrowserColorsOptionPane.java b/org/gjt/sp/jedit/options/BrowserColorsOptionPane.java
index 8d5389b..8b961bf 100644
--- a/org/gjt/sp/jedit/options/BrowserColorsOptionPane.java
+++ b/org/gjt/sp/jedit/options/BrowserColorsOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * BrowserColorsOptionPane.java - Browser colors options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2002 Slava Pestov
@@ -40,7 +40,7 @@ import org.gjt.sp.jedit.*;
 /**
  * Browser color editor.
  * @author Slava Pestov
- * @version $Id: BrowserColorsOptionPane.java 14468 2009-01-25 13:26:51Z kpouer $
+ * @version $Id: BrowserColorsOptionPane.java 22665 2013-01-11 16:25:33Z kpouer $
  */
 public class BrowserColorsOptionPane extends AbstractOptionPane
 {
@@ -124,8 +124,8 @@ public class BrowserColorsOptionPane extends AbstractOptionPane
 		int selectedRow = colorsTable.getSelectedRow();
 		remove.setEnabled(selectedRow != -1);
 		moveUp.setEnabled(selectedRow > 0);
-		moveUp.setEnabled(selectedRow != -1 && selectedRow !=
-			colorsModel.getRowCount());
+		moveDown.setEnabled(selectedRow != -1 && selectedRow !=
+			colorsModel.getRowCount() - 1);
 	} //}}}
 
 	//{{{ setSelectedRow() method
diff --git a/org/gjt/sp/jedit/options/BrowserContextOptionPane.java b/org/gjt/sp/jedit/options/BrowserContextOptionPane.java
index 9d20364..286cf0f 100644
--- a/org/gjt/sp/jedit/options/BrowserContextOptionPane.java
+++ b/org/gjt/sp/jedit/options/BrowserContextOptionPane.java
@@ -1,63 +1,63 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.options;
-
-import org.gjt.sp.jedit.gui.AbstractContextOptionPane;
-import org.gjt.sp.jedit.jEdit;
-
-/**
- * Right-click context menu editor.
- *
- * @author Matthieu Casanova
- * @version $Id: ContextOptionPane.java 12504 2008-04-22 23:12:43Z ezust $
- */
-public class BrowserContextOptionPane extends AbstractContextOptionPane
-{
-
-	public BrowserContextOptionPane()
-	{
-		super("browser.custom.context", jEdit.getProperty("options.browser.context.caption"));
-	}
-
-	/**
-	 * Returns jEdit's context menu configuration.
-	 *
-	 * @since jEdit 4.3pre13
-	 */
-	@Override
-	protected String getContextMenu()
-	{
-		return jEdit.getProperty("browser.custom.context");
-	}
-
-	/**
-	 * Saves jEdit's context menu configuration.
-	 *
-	 * @since jEdit 4.3pre13
-	 */
-	@Override
-	protected void saveContextMenu(String menu)
-	{
-		jEdit.setProperty("browser.custom.context", menu);
-	}
-
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.options;
+
+import org.gjt.sp.jedit.gui.AbstractContextOptionPane;
+import org.gjt.sp.jedit.jEdit;
+
+/**
+ * Right-click context menu editor.
+ *
+ * @author Matthieu Casanova
+ * @version $Id: ContextOptionPane.java 12504 2008-04-22 23:12:43Z ezust $
+ */
+public class BrowserContextOptionPane extends AbstractContextOptionPane
+{
+
+	public BrowserContextOptionPane()
+	{
+		super("browser.custom.context", jEdit.getProperty("options.browser.context.caption"));
+	}
+
+	/**
+	 * Returns jEdit's context menu configuration.
+	 *
+	 * @since jEdit 4.3pre13
+	 */
+	@Override
+	protected String getContextMenu()
+	{
+		return jEdit.getProperty("browser.custom.context");
+	}
+
+	/**
+	 * Saves jEdit's context menu configuration.
+	 *
+	 * @since jEdit 4.3pre13
+	 */
+	@Override
+	protected void saveContextMenu(String menu)
+	{
+		jEdit.setProperty("browser.custom.context", menu);
+	}
+
+}
diff --git a/org/gjt/sp/jedit/options/BrowserOptionPane.java b/org/gjt/sp/jedit/options/BrowserOptionPane.java
index 9e1e2e7..9ee564f 100644
--- a/org/gjt/sp/jedit/options/BrowserOptionPane.java
+++ b/org/gjt/sp/jedit/options/BrowserOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * BrowserOptionPane.java - Browser options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2001 Slava Pestov
@@ -32,7 +32,7 @@ import org.gjt.sp.jedit.*;
 //{{{ BrowserOptionPane class
 /**
  * @author Slava Pestov
- * @version $Id: BrowserOptionPane.java 20328 2011-11-13 05:59:59Z ezust $
+ * @version $Id: BrowserOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class BrowserOptionPane extends AbstractOptionPane
 {
diff --git a/org/gjt/sp/jedit/options/BufferOptionPane.java b/org/gjt/sp/jedit/options/BufferOptionPane.java
index 8d498ec..2839146 100644
--- a/org/gjt/sp/jedit/options/BufferOptionPane.java
+++ b/org/gjt/sp/jedit/options/BufferOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * BufferOptionPane.java -
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/options/ContextOptionPane.java b/org/gjt/sp/jedit/options/ContextOptionPane.java
index 5e39f5c..7e751c6 100644
--- a/org/gjt/sp/jedit/options/ContextOptionPane.java
+++ b/org/gjt/sp/jedit/options/ContextOptionPane.java
@@ -29,7 +29,7 @@ import org.gjt.sp.jedit.*;
 /**
  * Right-click context menu editor.
  * @author Slava Pestov
- * @version $Id: ContextOptionPane.java 21983 2012-08-07 15:29:11Z ezust $
+ * @version $Id: ContextOptionPane.java 21981 2012-08-06 19:19:16Z jarekczek $
  */
 public class ContextOptionPane extends AbstractContextOptionPane
 {
@@ -39,7 +39,7 @@ public class ContextOptionPane extends AbstractContextOptionPane
 	{
 		super("context", jEdit.getProperty("options.context.caption"));
 	}
-
+	
 	protected void _init()
 	{
 		super._init();
diff --git a/org/gjt/sp/jedit/options/DockingOptionPane.java b/org/gjt/sp/jedit/options/DockingOptionPane.java
index fce9974..51c6500 100644
--- a/org/gjt/sp/jedit/options/DockingOptionPane.java
+++ b/org/gjt/sp/jedit/options/DockingOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * DockingOptionPane.java - Dockable window options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/options/EditingOptionPane.java b/org/gjt/sp/jedit/options/EditingOptionPane.java
index 5cc538e..cf78e35 100644
--- a/org/gjt/sp/jedit/options/EditingOptionPane.java
+++ b/org/gjt/sp/jedit/options/EditingOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * EditingOptionPane.java - Mode-specific options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2002 Slava Pestov
@@ -35,7 +35,7 @@ import org.gjt.sp.util.StandardUtilities;
 
 /**
  * @author Slava Pestov
- * @version $Id: EditingOptionPane.java 21723 2012-05-27 14:34:13Z k_satoda $
+ * @version $Id: EditingOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class EditingOptionPane extends AbstractOptionPane
 {
diff --git a/org/gjt/sp/jedit/options/EncodingsOptionPane.java b/org/gjt/sp/jedit/options/EncodingsOptionPane.java
index 699717b..778c542 100644
--- a/org/gjt/sp/jedit/options/EncodingsOptionPane.java
+++ b/org/gjt/sp/jedit/options/EncodingsOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * EncodingsOptionPane.java - Encodings options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Björn Kautler
@@ -52,7 +52,7 @@ import static org.gjt.sp.jedit.MiscUtilities.getEncodings;
  * @author Björn Kautler
  * @author Matthieu Casanova
  * @since jEdit 4.3pre6
- * @version $Id: EncodingsOptionPane.java 20572 2011-12-07 21:43:12Z kpouer $
+ * @version $Id: EncodingsOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class EncodingsOptionPane extends AbstractOptionPane
 {
diff --git a/org/gjt/sp/jedit/options/FirewallOptionPane.java b/org/gjt/sp/jedit/options/FirewallOptionPane.java
index ed2b9b3..b39a8d4 100644
--- a/org/gjt/sp/jedit/options/FirewallOptionPane.java
+++ b/org/gjt/sp/jedit/options/FirewallOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * FirewallOptionPane.java - Firewall options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999 Dirk Moebius
diff --git a/org/gjt/sp/jedit/options/GeneralOptionPane.java b/org/gjt/sp/jedit/options/GeneralOptionPane.java
index af38609..4209dd8 100644
--- a/org/gjt/sp/jedit/options/GeneralOptionPane.java
+++ b/org/gjt/sp/jedit/options/GeneralOptionPane.java
@@ -1,9 +1,10 @@
 /*
  * GeneralOptionPane.java - General options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2003 Slava Pestov
+ *               2013 Thomas Meyer
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -25,7 +26,6 @@ package org.gjt.sp.jedit.options;
 //{{{ Imports
 import org.gjt.sp.jedit.AbstractOptionPane;
 import org.gjt.sp.jedit.jEdit;
-import org.gjt.sp.util.Log;
 
 import javax.swing.*;
 import javax.swing.event.ChangeEvent;
@@ -41,26 +41,25 @@ import java.awt.event.ActionListener;
 
 public class GeneralOptionPane extends AbstractOptionPane
 {
-	//{{{ checkFileStatus options
-	// Check the buffer status when the view got the focus
-	public static final int checkFileStatus_focus = 0;
-	// Check the file status when the view got the status
-	// or when saving or visiting the buffer
-	public static final int checkFileStatus_all = 1;
-	// Check the file status when visiting or saving <b>any</b> buffer
-	public static final int checkFileStatus_operations = 2;
-	// Check the file status when visiting or saving the buffer
-	public static final int checkFileStatus_focusBuffer = 3;
-	// Check the file status when saving the buffer
-	public static final int checkFileStatus_none = 4;
+	//{{{ checkFileStatus bit flags:
+	public static final int checkFileStatus_none = 0;
+
+	/** Check the buffer status when the view gets focus (low bit) */
+	public static final int checkFileStatus_focus = 1;
+
+	/** Check the file status when visiting the buffer (second bit) */
+	public static final int checkFileStatus_focusBuffer = 2;
+
+	/** This is actually a bitwise OR: (view focus | buffer focus) */ 
+	public static final int checkFileStatus_all = 3;	
 	//}}}
 
 	//{{{ Private members
 
 	private JComboBox checkModStatus;
 	private JComboBox checkModStatusUpon;
-	private JTextField recentFiles;
-	private JTextField hypersearchResultsWarning;
+	private JSpinner recentFiles;
+	private JSpinner hypersearchResultsWarning;
 	private JCheckBox saveCaret;
 	private JCheckBox sortRecent;
 	private JCheckBox persistentMarkers;
@@ -86,10 +85,10 @@ public class GeneralOptionPane extends AbstractOptionPane
 
 		/* Check mod status */
 		String[] modCheckOptions = {
-			jEdit.getProperty("options.general.checkModStatus.nothing"),
-			jEdit.getProperty("options.general.checkModStatus.prompt"),
-			jEdit.getProperty("options.general.checkModStatus.reload"),
-			jEdit.getProperty("options.general.checkModStatus.silentReload")
+				jEdit.getProperty("options.general.checkModStatus.nothing"),
+				jEdit.getProperty("options.general.checkModStatus.prompt"),
+				jEdit.getProperty("options.general.checkModStatus.reload"),
+				jEdit.getProperty("options.general.checkModStatus.silentReload")
 		};
 		checkModStatus = new JComboBox(modCheckOptions);
 		if(jEdit.getBooleanProperty("autoReload"))
@@ -109,51 +108,52 @@ public class GeneralOptionPane extends AbstractOptionPane
 				checkModStatus.setSelectedIndex(0);
 		}
 		addComponent(jEdit.getProperty("options.general.checkModStatus"),
-			checkModStatus);
+				checkModStatus);
 
 		/* Check mod status upon */
 		String[] modCheckUponOptions = {
-			jEdit.getProperty("options.general.checkModStatusUpon.focus"),
-			jEdit.getProperty("options.general.checkModStatusUpon.all"),
-			jEdit.getProperty("options.general.checkModStatusUpon.operations"),
-			jEdit.getProperty("options.general.checkModStatusUpon.focusBuffer"),
-			jEdit.getProperty("options.general.checkModStatusUpon.none")
+				jEdit.getProperty("options.general.checkModStatusUpon.none"),
+				jEdit.getProperty("options.general.checkModStatusUpon.focus"),
+				jEdit.getProperty("options.general.checkModStatusUpon.visitBuffer"),
+				jEdit.getProperty("options.general.checkModStatusUpon.all")
 		};
 		checkModStatusUpon = new JComboBox(modCheckUponOptions);
 
 		checkModStatusUpon.setSelectedIndex(jEdit.getIntegerProperty("checkFileStatus"));
 		addComponent(jEdit.getProperty("options.general.checkModStatusUpon"),
-			checkModStatusUpon);
+				checkModStatusUpon);
 
 		/* Recent file list size */
-		recentFiles = new JTextField(jEdit.getProperty(
-			"options.general.recentFiles"));
-		recentFiles.setText(jEdit.getProperty("recentFiles"));
-		addComponent(jEdit.getProperty("options.general.recentFiles"),
-			recentFiles);
+		{
+			String recentFilesLabel = jEdit.getProperty("options.general.recentFiles");
+			int recentFilesValue = jEdit.getIntegerProperty("recentFiles");
+			SpinnerModel model = new SpinnerNumberModel(recentFilesValue, 0, Integer.MAX_VALUE, 1);
+			recentFiles = new JSpinner(model);
+			addComponent(recentFilesLabel, recentFiles);
+		}
 
 		/* Sort recent file list */
 		sortRecent = new JCheckBox(jEdit.getProperty(
-			"options.general.sortRecent"));
+				"options.general.sortRecent"));
 		sortRecent.setSelected(jEdit.getBooleanProperty("sortRecent"));
 		addComponent(sortRecent);
 
 		/* Save caret positions */
 		saveCaret = new JCheckBox(jEdit.getProperty(
-			"options.general.saveCaret"));
+				"options.general.saveCaret"));
 		saveCaret.setSelected(jEdit.getBooleanProperty("saveCaret"));
 		addComponent(saveCaret);
 
 		/* Persistent markers */
 		persistentMarkers = new JCheckBox(jEdit.getProperty(
-			"options.general.persistentMarkers"));
+				"options.general.persistentMarkers"));
 		persistentMarkers.setSelected(jEdit.getBooleanProperty(
-			"persistentMarkers"));
+				"persistentMarkers"));
 		addComponent(persistentMarkers);
 
 		/* Session management */
 		restore = new JCheckBox(jEdit.getProperty(
-			"options.general.restore"));
+				"options.general.restore"));
 
 		restore.setSelected(jEdit.getBooleanProperty("restore"));
 		restore.addActionListener(new ActionListener()
@@ -169,26 +169,30 @@ public class GeneralOptionPane extends AbstractOptionPane
 		addComponent(restore);
 
 		restoreRemote = new JCheckBox(jEdit.getProperty(
-			"options.general.restore.remote"));
+				"options.general.restore.remote"));
 		restoreRemote.setSelected(jEdit.getBooleanProperty("restore.remote", false));
 		restoreRemote.setEnabled(restore.isSelected());
 		addComponent(restoreRemote);
 
 		restoreCLI = new JCheckBox(jEdit.getProperty(
-			"options.general.restore.cli"));
+				"options.general.restore.cli"));
 		restoreCLI.setSelected(jEdit.getBooleanProperty("restore.cli"));
 		restoreCLI.setEnabled(restore.isSelected());
 		addComponent(restoreCLI);
 
 		restoreSplits = new JCheckBox(jEdit.getProperty(
-			"options.general.restore.splits", "Restore split configuration"));
+				"options.general.restore.splits", "Restore split configuration"));
 		restoreSplits.setSelected(jEdit.getBooleanProperty("restore.splits", true));
 		addComponent(restoreSplits);
 
-		hypersearchResultsWarning = new JTextField(jEdit.getProperty("hypersearch.maxWarningResults"));
-		addComponent(jEdit.getProperty("options.general.hypersearch.maxWarningResults"),
-			hypersearchResultsWarning);
-
+		/* Maximum hypersearch results to ask for abort */
+		{
+			String maxWarnLabel = jEdit.getProperty("options.general.hypersearch.maxWarningResults");
+			int maxWarnValue = jEdit.getIntegerProperty("hypersearch.maxWarningResults");
+			SpinnerModel model = new SpinnerNumberModel(maxWarnValue, 0, Integer.MAX_VALUE, 1);
+			hypersearchResultsWarning = new JSpinner(model);
+			addComponent(maxWarnLabel, hypersearchResultsWarning);
+		}
 
 		String language = jEdit.getCurrentLanguage();
 
@@ -240,24 +244,19 @@ public class GeneralOptionPane extends AbstractOptionPane
 			break;
 		}
 		jEdit.setIntegerProperty("checkFileStatus", checkModStatusUpon.getSelectedIndex());
-		jEdit.setProperty("recentFiles", recentFiles.getText());
+		jEdit.setIntegerProperty("recentFiles", (Integer) recentFiles.getModel().getValue());
 		jEdit.setBooleanProperty("sortRecent",sortRecent.isSelected());
 		jEdit.setBooleanProperty("saveCaret",saveCaret.isSelected());
 		jEdit.setBooleanProperty("persistentMarkers",
-			persistentMarkers.isSelected());
+				persistentMarkers.isSelected());
 		jEdit.setBooleanProperty("restore",restore.isSelected());
 		jEdit.setBooleanProperty("restore.cli",restoreCLI.isSelected());
 		jEdit.setBooleanProperty("restore.remote", restoreRemote.isSelected());
 		jEdit.setBooleanProperty("restore.splits", restoreSplits.isSelected());
-		try
 		{
-			jEdit.setIntegerProperty("hypersearch.maxWarningResults", Integer.parseInt(hypersearchResultsWarning.getText()));
+			int maxWarnResults = (Integer) hypersearchResultsWarning.getModel().getValue();
+			jEdit.setIntegerProperty("hypersearch.maxWarningResults", maxWarnResults);
 		}
-		catch (NumberFormatException e)
-		{
-			Log.log(Log.WARNING, this, "hypersearchResultsWarning: " + hypersearchResultsWarning.getText() + " is not a valid value for this option");
-		}
-
 		jEdit.setBooleanProperty("lang.usedefaultlocale", useDefaultLocale.isSelected());
 		jEdit.setProperty("lang.current", String.valueOf(lang.getSelectedItem()));
 	} //}}}
@@ -267,10 +266,10 @@ public class GeneralOptionPane extends AbstractOptionPane
 	{
 		@Override
 		public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
-							      boolean cellHasFocus)
+				boolean cellHasFocus)
 		{
 			super.getListCellRendererComponent(list, value, index, isSelected,
-							   cellHasFocus);
+					cellHasFocus);
 			String label = jEdit.getProperty("options.appearance.lang."+value);
 			if (label != null)
 				setText(label);
diff --git a/org/gjt/sp/jedit/options/GlobalOptions.java b/org/gjt/sp/jedit/options/GlobalOptions.java
index 3c7df16..35b0c45 100644
--- a/org/gjt/sp/jedit/options/GlobalOptions.java
+++ b/org/gjt/sp/jedit/options/GlobalOptions.java
@@ -1,6 +1,6 @@
 /*
  * GlobalOptions.java - Global options dialog
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Slava Pestov
@@ -30,7 +30,7 @@ import org.gjt.sp.jedit.msg.PropertiesChanging;
 import org.gjt.sp.jedit.*;
 //}}}
 /**
-   @deprecated - use CombinedOptions
+   A dialog that can open initially to one of the Global Option Panes.
 */
 public class GlobalOptions extends OptionsDialog
 {
diff --git a/org/gjt/sp/jedit/options/GutterOptionPane.java b/org/gjt/sp/jedit/options/GutterOptionPane.java
index 751380c..65fa30f 100644
--- a/org/gjt/sp/jedit/options/GutterOptionPane.java
+++ b/org/gjt/sp/jedit/options/GutterOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * GutterOptionPane.java - Gutter options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000 mike dillon
diff --git a/org/gjt/sp/jedit/options/MouseOptionPane.java b/org/gjt/sp/jedit/options/MouseOptionPane.java
index d8f0e2d..fcb9b6c 100644
--- a/org/gjt/sp/jedit/options/MouseOptionPane.java
+++ b/org/gjt/sp/jedit/options/MouseOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * MouseOptionPane.java - Editor window options
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/options/PluginManagerOptionPane.java b/org/gjt/sp/jedit/options/PluginManagerOptionPane.java
index 19fe74e..72d1d14 100644
--- a/org/gjt/sp/jedit/options/PluginManagerOptionPane.java
+++ b/org/gjt/sp/jedit/options/PluginManagerOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * PluginManagerOptionPane.java - Plugin options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Kris Kopicki
@@ -37,7 +37,7 @@ import org.gjt.sp.util.*;
 /**
  * The plugin manager option pane.
  * 
- * @version $Id: PluginManagerOptionPane.java 17941 2010-06-01 14:22:58Z kpouer $
+ * @version $Id: PluginManagerOptionPane.java 22357 2012-10-13 04:58:01Z ezust $
  */
 public class PluginManagerOptionPane extends AbstractOptionPane
 {
@@ -70,10 +70,10 @@ public class PluginManagerOptionPane extends AbstractOptionPane
 			cacheForSpinner = new JSpinner(spinnerModel);
 			spinnerPanel = new JPanel();
 			spinnerPanel.setLayout(new BoxLayout(spinnerPanel, BoxLayout.X_AXIS));
-			spinnerPanel.add(new JLabel("Cache plugin list for: (minutes)"));
+			spinnerPanel.add(new JLabel(jEdit.getProperty("options.plugin-manager.list-cache.minutes")));
 			spinnerPanel.add(cacheForSpinner);
 			spinnerPanel.add(Box.createGlue());
-			
+
 		}
 		JRadioButton appDir = new JRadioButton(jEdit.getProperty(
 				"options.plugin-manager.app-dir"));
@@ -112,8 +112,6 @@ public class PluginManagerOptionPane extends AbstractOptionPane
 		downloadSource.setAlignmentX(Component.LEFT_ALIGNMENT);
 		buttonPanel.add(downloadSource);
 
-		buttonPanel.add(Box.createVerticalStrut(6));
-
 		/* Delete downloaded files */
 		deleteDownloads = new JCheckBox(jEdit.getProperty(
 			"options.plugin-manager.deleteDownloads"));
@@ -121,6 +119,14 @@ public class PluginManagerOptionPane extends AbstractOptionPane
 		deleteDownloads.setAlignmentX(Component.LEFT_ALIGNMENT);
 		buttonPanel.add(deleteDownloads);
 
+		/* Disable obsolete plugins */
+		disableObsolete = new JCheckBox(jEdit.getProperty(
+			"options.plugin-manager.disable-obsolete"));
+		disableObsolete.setSelected(jEdit.getBooleanProperty("plugin-manager.disable-obsolete", true));
+		disableObsolete.setAlignmentX(Component.LEFT_ALIGNMENT);
+		buttonPanel.add(disableObsolete);
+
+
 		buttonPanel.add(Box.createVerticalStrut(6));
 
 		/* Install location */
@@ -130,7 +136,7 @@ public class PluginManagerOptionPane extends AbstractOptionPane
 		locGrp.add(appDir);
 		JPanel locPanel = new JPanel();
 		locPanel.setLayout(new BoxLayout(locPanel,BoxLayout.Y_AXIS));
-		
+
 		if(jEdit.getSettingsDirectory() != null)
 		{
 			locPanel.add(settingsDir);
@@ -160,6 +166,7 @@ public class PluginManagerOptionPane extends AbstractOptionPane
 		jEdit.setBooleanProperty("plugin-manager.downloadSource",downloadSource.isSelected());
 		jEdit.setBooleanProperty("plugin-manager.deleteDownloads",deleteDownloads.isSelected());
 		jEdit.setIntegerProperty("plugin-manager.list-cache.minutes", spinnerModel.getNumber().intValue());
+		jEdit.setBooleanProperty("plugin-manager.disable-obsolete", disableObsolete.isSelected());
 		if(miraList.getSelectedIndex() != -1)
 		{
 			String currentMirror = miraModel.getID(miraList.getSelectedIndex());
@@ -180,6 +187,7 @@ public class PluginManagerOptionPane extends AbstractOptionPane
 	//{{{ Instance variables
 	private JLabel mirrorLabel;
 
+	private JCheckBox disableObsolete;
 	private JRadioButton settingsDir;
 	private JCheckBox downloadSource;
 	private JCheckBox deleteDownloads;
@@ -388,7 +396,7 @@ public class PluginManagerOptionPane extends AbstractOptionPane
 			}
 			finally
 			{
-				IOUtilities.closeQuietly(out);
+				IOUtilities.closeQuietly((Closeable)out);
 			}
 		} //}}}
 	} //}}}
diff --git a/org/gjt/sp/jedit/options/PluginOptions.java b/org/gjt/sp/jedit/options/PluginOptions.java
index 1fcbaec..bf6c7b4 100644
--- a/org/gjt/sp/jedit/options/PluginOptions.java
+++ b/org/gjt/sp/jedit/options/PluginOptions.java
@@ -1,6 +1,6 @@
 /*
  * PluginOptions.java - Plugin options dialog
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/options/PrintOptionPane.java b/org/gjt/sp/jedit/options/PrintOptionPane.java
index 274ab56..af5ef4e 100644
--- a/org/gjt/sp/jedit/options/PrintOptionPane.java
+++ b/org/gjt/sp/jedit/options/PrintOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * PrintOptionPane.java - Printing options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2002 Slava Pestov
diff --git a/org/gjt/sp/jedit/options/SaveBackupOptionPane.java b/org/gjt/sp/jedit/options/SaveBackupOptionPane.java
index a3b1560..583835c 100644
--- a/org/gjt/sp/jedit/options/SaveBackupOptionPane.java
+++ b/org/gjt/sp/jedit/options/SaveBackupOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * AutosaveBackupOptionPane.java - Autosave & backup options
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -35,7 +35,7 @@ import org.gjt.sp.jedit.browser.VFSBrowser;
  * The Save and Backup option panel.
  *
  * @author Slava Pestov
- * @author $Id: SaveBackupOptionPane.java 21743 2012-05-31 20:23:35Z ezust $
+ * @author $Id: SaveBackupOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class SaveBackupOptionPane extends AbstractOptionPane
 {
diff --git a/org/gjt/sp/jedit/options/ShortcutsOptionPane.java b/org/gjt/sp/jedit/options/ShortcutsOptionPane.java
index 7d214d8..656b42c 100644
--- a/org/gjt/sp/jedit/options/ShortcutsOptionPane.java
+++ b/org/gjt/sp/jedit/options/ShortcutsOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * ShortcutsOptionPane.java - Shortcuts options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2000, 2001 Slava Pestov
@@ -49,7 +49,7 @@ import java.util.List;
 /**
  * Key binding editor.
  * @author Slava Pestov
- * @version $Id: ShortcutsOptionPane.java 22380 2012-10-15 02:49:41Z ezust $
+ * @version $Id: ShortcutsOptionPane.java 23082 2013-07-27 16:01:18Z ezust $
  */
 @SuppressWarnings("serial")
 public class ShortcutsOptionPane extends AbstractOptionPane
@@ -256,7 +256,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 					Log.log(Log.ERROR,this,"Empty action set: "
 						+ actionSet.getPluginJAR());
 				}
-				ShortcutsModel model = createModel(modelLabel,
+				ShortcutsModel model = createModel(actionSet.getLabel(), modelLabel,
 						actionSet.getActionNames());
 				models.add(model);
 				List<KeyBinding[]> bindings = model.getBindings();
@@ -272,7 +272,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 			}
 		}
 		if (models.size() > 1)
-			models.add(new ShortcutsModel("All", allBindings));
+			models.add(new ShortcutsModel(ShortcutsModel.ALL, allBindings));
 		ShortcutsModel delegated = filteredModel.getDelegated();
 		Collections.sort(models,new StandardUtilities.StringCompare<ShortcutsModel>(true));
 		if (delegated == null)
@@ -296,7 +296,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 	} //}}}
 
 	//{{{ createModel() method
-	private ShortcutsModel createModel(String modelLabel, String[] actions)
+	private ShortcutsModel createModel(String actionSet, String modelLabel, String[] actions)
 	{
 		List<GrabKeyDialog.KeyBinding[]> bindings = new ArrayList<GrabKeyDialog.KeyBinding[]>(actions.length);
 
@@ -310,28 +310,27 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 				continue;
 
 			label = GUIUtilities.prettifyMenuLabel(label);
-			addBindings(name,label,bindings);
+			addBindings(actionSet, name,label,bindings);
 		}
 
 		return new ShortcutsModel(modelLabel,bindings);
 	} //}}}
 
 	//{{{ addBindings() method
-	private void addBindings(String name, String label, Collection<KeyBinding[]> bindings)
+	private void addBindings(String actionSet, String name, String label, Collection<KeyBinding[]> bindings)
 	{
 		GrabKeyDialog.KeyBinding[] b = new GrabKeyDialog.KeyBinding[2];
 
-		b[0] = createBinding(name,label,
+		b[0] = createBinding(actionSet, name,label,
 			selectedKeymap.getShortcut(name + ".shortcut"));
-		b[1] = createBinding(name,label,
+		b[1] = createBinding(actionSet, name,label,
 			selectedKeymap.getShortcut(name + ".shortcut2"));
 
 		bindings.add(b);
 	} //}}}
 
 	//{{{ createBinding() method
-	private GrabKeyDialog.KeyBinding createBinding(String name,
-		String label, String shortcut)
+	private GrabKeyDialog.KeyBinding createBinding(String actionSet, String name, String label, String shortcut)
 	{
 		if(shortcut != null && shortcut.length() == 0)
 			shortcut = null;
@@ -339,6 +338,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 		GrabKeyDialog.KeyBinding binding
 			= new GrabKeyDialog.KeyBinding(name,label,shortcut,false);
 
+		binding.actionSet = actionSet;
 		allBindings.add(binding);
 		return binding;
 	} //}}}
@@ -503,6 +503,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 	//{{{ ShortcutsModel class
 	private class ShortcutsModel extends AbstractTableModel
 	{
+		public static final String ALL = "All";
 		private final List<GrabKeyDialog.KeyBinding[]> bindings;
 		private final String name;
 
@@ -526,6 +527,8 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 		@Override
 		public int getColumnCount()
 		{
+			if (ALL.equals(name))
+				return 4;
 			return 3;
 		}
 
@@ -548,6 +551,8 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 				return GUIUtilities.getPlatformShortcutLabel(getBindingAt(row,0).shortcut);
 			case 2:
 				return GUIUtilities.getPlatformShortcutLabel(getBindingAt(row,1).shortcut);
+			case 3:
+				return getBindingAt(row, 0).actionSet;
 			default:
 				return null;
 			}
@@ -574,9 +579,11 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 			case 0:
 				return jEdit.getProperty("options.shortcuts.name");
 			case 1:
-				return selectedKeymap.getShortcut("options.shortcuts.shortcut1");
+				return jEdit.getProperty("options.shortcuts.shortcut1");
 			case 2:
-				return selectedKeymap.getShortcut("options.shortcuts.shortcut2");
+				return jEdit.getProperty("options.shortcuts.shortcut2");
+			case 3:
+				return jEdit.getProperty("options.shortcuts.actionset");
 			default:
 				return null;
 			}
diff --git a/org/gjt/sp/jedit/options/StatusBarOptionPane.java b/org/gjt/sp/jedit/options/StatusBarOptionPane.java
index 1753077..e9117cf 100644
--- a/org/gjt/sp/jedit/options/StatusBarOptionPane.java
+++ b/org/gjt/sp/jedit/options/StatusBarOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * StatusBarOptionPane.java - Tool bar options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008-2012 Matthieu Casanova
@@ -38,7 +38,7 @@ import org.gjt.sp.jedit.*;
 /**
  * Status bar editor.
  * @author Matthieu Casanova
- * @version $Id: StatusBarOptionPane.java 21616 2012-04-30 08:32:24Z kpouer $
+ * @version $Id: StatusBarOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class StatusBarOptionPane extends AbstractOptionPane
 {
diff --git a/org/gjt/sp/jedit/options/SyntaxHiliteOptionPane.java b/org/gjt/sp/jedit/options/SyntaxHiliteOptionPane.java
index 59d1ead..5f51eb8 100644
--- a/org/gjt/sp/jedit/options/SyntaxHiliteOptionPane.java
+++ b/org/gjt/sp/jedit/options/SyntaxHiliteOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * SyntaxHiliteOptionPane.java - Syntax highlighting option pane
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2000, 2001 Slava Pestov
@@ -42,7 +42,7 @@ import org.gjt.sp.util.StandardUtilities;
 /**
  * Style option pane.
  * @author Slava Pestov
- * @version $Id: SyntaxHiliteOptionPane.java 14127 2008-12-01 10:10:57Z kpouer $
+ * @version $Id: SyntaxHiliteOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class SyntaxHiliteOptionPane extends AbstractOptionPane
 {
diff --git a/org/gjt/sp/jedit/options/TextAreaOptionPane.java b/org/gjt/sp/jedit/options/TextAreaOptionPane.java
index 84a0325..03da8c9 100644
--- a/org/gjt/sp/jedit/options/TextAreaOptionPane.java
+++ b/org/gjt/sp/jedit/options/TextAreaOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * TextAreaOptionPane.java - Text area options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 1999, 2000 Slava Pestov
@@ -40,7 +40,7 @@ import org.gjt.sp.jedit.gui.RolloverButton;
 
 /**
  * @author Slava Pestov
- * @version $Id: TextAreaOptionPane.java 20953 2012-01-25 19:35:49Z ezust $
+ * @version $Id: TextAreaOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class TextAreaOptionPane extends AbstractOptionPane
 {
diff --git a/org/gjt/sp/jedit/options/ToolBarOptionPane.java b/org/gjt/sp/jedit/options/ToolBarOptionPane.java
index 4f15534..9f2e192 100644
--- a/org/gjt/sp/jedit/options/ToolBarOptionPane.java
+++ b/org/gjt/sp/jedit/options/ToolBarOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * ToolBarOptionPane.java - Tool bar options panel
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2001, 2002 Slava Pestov
@@ -42,7 +42,7 @@ import org.gjt.sp.util.StandardUtilities;
 /**
  * Tool bar editor.
  * @author Slava Pestov
- * @version $Id: ToolBarOptionPane.java 20328 2011-11-13 05:59:59Z ezust $
+ * @version $Id: ToolBarOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class ToolBarOptionPane extends AbstractOptionPane
 {
diff --git a/org/gjt/sp/jedit/options/ViewOptionPane.java b/org/gjt/sp/jedit/options/ViewOptionPane.java
index 31795ab..fb43b29 100644
--- a/org/gjt/sp/jedit/options/ViewOptionPane.java
+++ b/org/gjt/sp/jedit/options/ViewOptionPane.java
@@ -1,6 +1,6 @@
 /*
  * ViewOptionPane.java - Editor window options
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -95,6 +95,13 @@ public class ViewOptionPane extends AbstractOptionPane
 			"view.toolbar.floatable"));
 		addComponent(floatableToolbars);
 
+		/* Abbreviate pathnames when possible */		
+		abbreviatePaths = new JCheckBox(jEdit.getProperty(
+			"options.view.abbreviatePaths"));
+		abbreviatePaths.setSelected(jEdit.getBooleanProperty(
+			"view.abbreviatePaths"));
+		addComponent(abbreviatePaths);
+		
 		/* Show full path */
 		showFullPath = new JCheckBox(jEdit.getProperty(
 			"options.view.showFullPath"));
@@ -200,8 +207,8 @@ public class ViewOptionPane extends AbstractOptionPane
 		jEdit.setBooleanProperty("view.toolbar.alternateLayout",
 			layout.getIcon() == layoutIcon3
 			|| layout.getIcon() == layoutIcon4);
-		jEdit.setBooleanProperty("view.showFullPath",showFullPath
-			.isSelected());
+		jEdit.setBooleanProperty("view.abbreviatePaths",abbreviatePaths.isSelected());		
+		jEdit.setBooleanProperty("view.showFullPath",showFullPath.isSelected());
 		jEdit.setBooleanProperty("view.toolbar.floatable", floatableToolbars.isSelected());
 
 		jEdit.setBooleanProperty("view.showSearchbar",showSearchbar
@@ -225,6 +232,7 @@ public class ViewOptionPane extends AbstractOptionPane
 	private JLabel layout;
 	private Icon layoutIcon1, layoutIcon2, layoutIcon3, layoutIcon4;
 	private JButton alternateDockingLayout, alternateToolBarLayout;
+	private JCheckBox abbreviatePaths;
 	private JCheckBox showFullPath;
 	private JCheckBox floatableToolbars;
 	private JCheckBox showSearchbar;
diff --git a/org/gjt/sp/jedit/pluginmgr/InstallPanel.java b/org/gjt/sp/jedit/pluginmgr/InstallPanel.java
index 50461a8..b43f5dd 100644
--- a/org/gjt/sp/jedit/pluginmgr/InstallPanel.java
+++ b/org/gjt/sp/jedit/pluginmgr/InstallPanel.java
@@ -1,6 +1,6 @@
 /*
  * InstallPanel.java - For installing plugins
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Kris Kopicki
@@ -48,7 +48,6 @@ import javax.swing.table.AbstractTableModel;
 import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.table.JTableHeader;
 import javax.swing.table.TableColumn;
-import javax.swing.text.html.HTMLEditorKit;
 import java.awt.*;
 import java.awt.event.*;
 import java.io.File;
@@ -61,7 +60,7 @@ import java.util.List;
 //}}}
 
 /**
- * @version $Id: InstallPanel.java 21767 2012-06-05 13:09:28Z kpouer $
+ * @version $Id: InstallPanel.java 22967 2013-05-06 09:15:44Z kpouer $
  */
 class InstallPanel extends JPanel implements EBComponent
 {
@@ -74,6 +73,7 @@ class InstallPanel extends JPanel implements EBComponent
 	private final PluginInfoBox infoBox;
 	private final ChoosePluginSet chooseButton;
 	private final boolean updates;
+	private final CardLayout layout;
 
 	private final Collection<String> pluginSet = new HashSet<String>();
 	//}}}
@@ -81,7 +81,8 @@ class InstallPanel extends JPanel implements EBComponent
 	//{{{ InstallPanel constructor
 	InstallPanel(PluginManager window, boolean updates)
 	{
-		super(new BorderLayout(12,12));
+		super(null);
+		setLayout(layout = new CardLayout());
 
 		this.window = window;
 		this.updates = updates;
@@ -206,8 +207,6 @@ class InstallPanel extends JPanel implements EBComponent
 		Box filterBox = Box.createHorizontalBox();
 		filterBox.add(new JLabel("Filter : "));
 		filterBox.add(searchField);
-		add(BorderLayout.NORTH,filterBox);
-		add(BorderLayout.CENTER,split);
 
 		/* Create buttons */
 		Box buttons = new Box(BoxLayout.X_AXIS);
@@ -220,8 +219,31 @@ class InstallPanel extends JPanel implements EBComponent
 		buttons.add(Box.createGlue());
 		buttons.add(new SizeLabel());
 
+		JPanel _installPanel = new JPanel(new BorderLayout(12, 12));
+		_installPanel.add(BorderLayout.NORTH,filterBox);
+		_installPanel.add(BorderLayout.CENTER,split);
+		_installPanel.add(BorderLayout.SOUTH, buttons);
 
-		add(BorderLayout.SOUTH,buttons);
+		add(_installPanel, "INSTALL");
+
+		JPanel loadingLabelPanel = new JPanel(new GridBagLayout());
+		loadingLabelPanel.add(new JLabel("<html><b><strong>" + jEdit.getProperty("common.loading", "Loading...") +
+								  "</strong></b></html>"));
+		add(loadingLabelPanel, "LOADING");
+
+		JPanel noAvailablePluginsPanel = new JPanel(new GridBagLayout());
+		noAvailablePluginsPanel.add(new JLabel("<html><b><strong>" +
+			jEdit.getProperty("options.plugin-manager.no-plugin-available", "No available plugins...") +
+			"</strong></b></html>"));
+		add(noAvailablePluginsPanel, "NO_PLUGIN_AVAILABLE");
+
+		JPanel pluginsAreUpToDatePanel = new JPanel(new GridBagLayout());
+		pluginsAreUpToDatePanel.add(new JLabel("<html><b><strong>" +
+			jEdit.getProperty("options.plugin-manager.no-plugin-uptodate", "Plugins are up to date...") +
+			"</strong></b></html>"));
+		add(pluginsAreUpToDatePanel, "PLUGIN_ARE_UP_TO_DATE");
+
+		layout.show(this, "INSTALL");
 		String path = jEdit.getProperty(PluginManager.PROPERTY_PLUGINSET, "");
 		if (!path.isEmpty())
 		{
@@ -273,6 +295,15 @@ class InstallPanel extends JPanel implements EBComponent
 				infoBox.setText(null);
 				pluginModel.update();
 				pluginModel.restoreSelection(savedChecked, savedSelection);
+				if (pluginModel.getRowCount() == 0)
+				{
+					if (updates)
+						layout.show(InstallPanel.this, "PLUGIN_ARE_UP_TO_DATE");
+					else
+						layout.show(InstallPanel.this, "NO_PLUGIN_AVAILABLE");
+				}
+				else
+					layout.show(InstallPanel.this, "INSTALL");
 			}
 		});
 	} //}}}
@@ -293,6 +324,12 @@ class InstallPanel extends JPanel implements EBComponent
 		}
 	} //}}}
 
+	//{{{ loading() method
+	void loading()
+	{
+		layout.show(this, "LOADING");
+	} //}}}
+
 	//{{{ Private members
 
 	//{{{ formatSize() method
@@ -587,6 +624,7 @@ class InstallPanel extends JPanel implements EBComponent
 				}
 			}
 			updateFilteredEntries();
+			table.setRowSelectionInterval(row, row);
 		} //}}}
 
 		//{{{ sort() method
@@ -829,7 +867,7 @@ class InstallPanel extends JPanel implements EBComponent
 		@Override
 		public void valueChanged(ListSelectionEvent e)
 		{
-			String text = "";
+			String text = getText();
 			if (table.getSelectedRowCount() == 1)
 			{
 				Entry entry = (Entry) pluginModel.filteredEntries
diff --git a/org/gjt/sp/jedit/pluginmgr/KeyboardCommand.java b/org/gjt/sp/jedit/pluginmgr/KeyboardCommand.java
index 2417c5d..b6d7257 100644
--- a/org/gjt/sp/jedit/pluginmgr/KeyboardCommand.java
+++ b/org/gjt/sp/jedit/pluginmgr/KeyboardCommand.java
@@ -1,6 +1,6 @@
 /*
  * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright © 2010 jEdit contributors
diff --git a/org/gjt/sp/jedit/pluginmgr/ManagePanel.java b/org/gjt/sp/jedit/pluginmgr/ManagePanel.java
index c5257db..9adb84e 100644
--- a/org/gjt/sp/jedit/pluginmgr/ManagePanel.java
+++ b/org/gjt/sp/jedit/pluginmgr/ManagePanel.java
@@ -1,6 +1,6 @@
 /*
  * ManagePanel.java - Manages plugins
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Kris Kopicki
@@ -267,19 +267,31 @@ public class ManagePanel extends JPanel
 		{
 			pluginCacheEntry = pluginJAR.generateCache();
 		}
-		Properties cachedProperties = pluginCacheEntry.cachedProperties;
+		if(pluginCacheEntry == null)
+		{
+			// this happens when, for some reason, two versions
+			// of a plugin are installed, e.g when XSLT.jar and
+			// xslt.jar are both in $JEDIT_HOME/jars on Linux.
+			Log.log(Log.WARNING, ManagePanel.class,
+					"couldn't load plugin "+pluginJAR.getPath()
+					+" (most likely other version exists)");
+		}
+		else
+		{
+			Properties cachedProperties = pluginCacheEntry.cachedProperties;
 
-		String jars = cachedProperties.getProperty("plugin." + pluginCacheEntry.pluginClass + ".jars");
+			String jars = cachedProperties.getProperty("plugin." + pluginCacheEntry.pluginClass + ".jars");
 
-		if (jars != null)
-		{
-			String dir = MiscUtilities.getParentOfPath(pluginJAR.getPath());
-			StringTokenizer st = new StringTokenizer(jars);
-			while (st.hasMoreTokens())
+			if (jars != null)
 			{
-				String _jarPath = MiscUtilities.constructPath(dir, st.nextToken());
-				if (new File(_jarPath).exists())
-					jarList.add(_jarPath);
+				String dir = MiscUtilities.getParentOfPath(pluginJAR.getPath());
+				StringTokenizer st = new StringTokenizer(jars);
+				while (st.hasMoreTokens())
+				{
+					String _jarPath = MiscUtilities.constructPath(dir, st.nextToken());
+					if (new File(_jarPath).exists())
+						jarList.add(_jarPath);
+				}
 			}
 		}
 		jarList.add(jarName);
@@ -291,9 +303,12 @@ public class ManagePanel extends JPanel
 	//{{{ Entry class
 	static class Entry
 	{
-		static final String ERROR = "error";
 		static final String LOADED = "loaded";
 		static final String NOT_LOADED = "not-loaded";
+		/** Partially loaded, and marked as "error" due to unsatisfied depends. */
+		static final String ERROR = "error";
+		/** Not loaded, marked Unsupported in plugin manager. */
+		static final String DISABLED = "disabled";
 
 		final String status;
 		/** The jar path. */
@@ -323,7 +338,9 @@ public class ManagePanel extends JPanel
 			jars = new LinkedList<String>();
 			this.jar = jar;
 			jars.add(this.jar);
-			status = NOT_LOADED;
+			if (jEdit.getBooleanProperty("plugin." + MiscUtilities.getFileName(jar) + ".disabled"))
+				status = DISABLED;
+			else status = NOT_LOADED;
 		}
 
 		/**
@@ -457,7 +474,8 @@ public class ManagePanel extends JPanel
 			switch (columnIndex)
 			{
 				case 0:
-					return Boolean.valueOf(!entry.status.equals(Entry.NOT_LOADED));
+					return Boolean.valueOf(!entry.status.equals(Entry.NOT_LOADED) &&
+							!entry.status.equals(Entry.DISABLED));
 				case 1:
 					if(entry.name == null)
 					{
@@ -726,7 +744,7 @@ public class ManagePanel extends JPanel
 			boolean isSelected, boolean hasFocus, int row, int column)
 		{
 			Entry entry = pluginModel.getEntry(row);
-			if (entry.status.equals(Entry.ERROR))
+			if (entry.status.equals(Entry.ERROR) || entry.status.equals(Entry.DISABLED))
 				tcr.setForeground(Color.red);
 			else
 				tcr.setForeground(UIManager.getColor("Table.foreground"));
@@ -831,7 +849,7 @@ public class ManagePanel extends JPanel
 			try
 			{
 				OutputStream os = vfs._createOutputStream(session, vfsURL, ManagePanel.this);
-				writer = new BufferedWriter(new OutputStreamWriter(os));
+				writer = new BufferedWriter(new OutputStreamWriter(os, "utf-8"));
 				writer.write(sb.toString());
 			}
 			catch (Exception e)
@@ -840,7 +858,7 @@ public class ManagePanel extends JPanel
 			}
 			finally
 			{
-				IOUtilities.closeQuietly(writer);
+				IOUtilities.closeQuietly((Closeable)writer);
 			}
 
 		}
@@ -901,7 +919,7 @@ public class ManagePanel extends JPanel
 			for(int i = 0; i < selected.length; i++)
 			{
 				Entry entry = pluginModel.getEntry(selected[i]);
-				if (entry.status.equals(Entry.NOT_LOADED))
+				if (entry.status.equals(Entry.NOT_LOADED) || entry.status.equals(Entry.DISABLED))
 				{
 					if (entry.jar != null)
 					{
@@ -1024,7 +1042,16 @@ public class ManagePanel extends JPanel
 					{
 						pluginCacheEntry = pluginJAR.generateCache();
 					}
-					if (pluginCacheEntry.pluginClass == null)
+					if(pluginCacheEntry == null)
+					{
+						// this happens when, for some reason, two versions
+						// of a plugin are installed, e.g when XSLT.jar and
+						// xslt.jar are both in $JEDIT_HOME/jars on Linux.
+						Log.log(Log.WARNING, ManagePanel.class,
+								"couldn't load plugin "+pluginJAR.getPath()
+								+" (most likely other version exists)");
+					}
+					if (pluginCacheEntry == null || pluginCacheEntry.pluginClass == null)
 					{
 						// Not a plugin
 						jarlibs.put(new File(notLoadedJars[i]).getName(), notLoadedJars[i]);
diff --git a/org/gjt/sp/jedit/pluginmgr/MirrorList.java b/org/gjt/sp/jedit/pluginmgr/MirrorList.java
index 182b8bd..7e0bd70 100644
--- a/org/gjt/sp/jedit/pluginmgr/MirrorList.java
+++ b/org/gjt/sp/jedit/pluginmgr/MirrorList.java
@@ -1,6 +1,6 @@
 /*
  * MirrorList.java - Mirrors list
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Kris Kopicki
@@ -38,7 +38,7 @@ import org.gjt.sp.util.Log;
 //}}}
 
 /**
- * @version $Id: MirrorList.java 17940 2010-06-01 13:27:24Z kpouer $
+ * @version $Id: MirrorList.java 22357 2012-10-13 04:58:01Z ezust $
  */
 public class MirrorList
 {
@@ -126,7 +126,7 @@ public class MirrorList
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(inputStream);
+			IOUtilities.closeQuietly((Closeable)inputStream);
 		}
 	} //}}}
 
@@ -151,7 +151,7 @@ public class MirrorList
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(inputStream);
+			IOUtilities.closeQuietly((Closeable)inputStream);
 		}
 	} //}}}
 
diff --git a/org/gjt/sp/jedit/pluginmgr/MirrorListHandler.java b/org/gjt/sp/jedit/pluginmgr/MirrorListHandler.java
index 879c3e4..e2a7d38 100644
--- a/org/gjt/sp/jedit/pluginmgr/MirrorListHandler.java
+++ b/org/gjt/sp/jedit/pluginmgr/MirrorListHandler.java
@@ -1,6 +1,6 @@
 /*
  * MirrorListHandler.java - XML handler for the mirrors list
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Kris Kopicki (parts copied from Slava Pestov :) )
@@ -33,7 +33,7 @@ import org.gjt.sp.util.Log;
 import org.gjt.sp.jedit.options.PluginOptions;
 
 /**
- * @version $Id: MirrorListHandler.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: MirrorListHandler.java 21831 2012-06-18 22:54:17Z ezust $
  */
 class MirrorListHandler extends DefaultHandler
 {
diff --git a/org/gjt/sp/jedit/pluginmgr/PluginDetailPanel.java b/org/gjt/sp/jedit/pluginmgr/PluginDetailPanel.java
index ab55a94..3039596 100644
--- a/org/gjt/sp/jedit/pluginmgr/PluginDetailPanel.java
+++ b/org/gjt/sp/jedit/pluginmgr/PluginDetailPanel.java
@@ -1,6 +1,6 @@
 /*
  * PluginDetailPanel.java - Displays the details of a plugin
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/pluginmgr/PluginList.java b/org/gjt/sp/jedit/pluginmgr/PluginList.java
index bca5054..9c69757 100644
--- a/org/gjt/sp/jedit/pluginmgr/PluginList.java
+++ b/org/gjt/sp/jedit/pluginmgr/PluginList.java
@@ -1,6 +1,6 @@
 /*
  * PluginList.java - Plugin list downloaded from server
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2003 Slava Pestov
@@ -40,7 +40,7 @@ import org.gjt.sp.jedit.*;
 /**
  * Plugin list downloaded from server.
  * @since jEdit 3.2pre2
- * @version $Id: PluginList.java 21741 2012-05-31 17:42:05Z k_satoda $
+ * @version $Id: PluginList.java 22357 2012-10-13 04:58:01Z ezust $
  */
 class PluginList
 {
@@ -70,7 +70,7 @@ class PluginList
 		this.task = task;
 		readPluginList(true);
 	}
-	
+
 	void readPluginList(boolean allowRetry)
 	{
 		String mirror = buildMirror(id);
@@ -119,7 +119,7 @@ class PluginList
 		InputStream in = null, inputStream = null;
 		try
 		{
-			if (cachedURL != gzipURL) 
+			if (cachedURL != gzipURL)
 				Log.log(Log.MESSAGE, this, "Using cached pluginlist");
 			inputStream = new URL(cachedURL).openStream();
 			XMLReader parser = XMLReaderFactory.createXMLReader();
@@ -142,7 +142,7 @@ class PluginList
 			parser.setEntityResolver(handler);
 			parser.setErrorHandler(handler);
 			parser.parse(isrc);
-				
+
 		}
 		catch (Exception e)
 		{
@@ -162,12 +162,12 @@ class PluginList
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(in);
-			IOUtilities.closeQuietly(inputStream);
+			IOUtilities.closeQuietly((Closeable)in);
+			IOUtilities.closeQuietly((Closeable)inputStream);
 		}
-		
+
 	}
-	
+
 	/** Caches it locally */
 	void downloadPluginList()
 	{
@@ -182,7 +182,7 @@ class PluginList
 		 **/
 		try
 		{
-			
+
 			task.setStatus(jEdit.getProperty("plugin-manager.list-download"));
 			URL downloadURL = new URL(gzipURL);
 			HttpURLConnection c = (HttpURLConnection)downloadURL.openConnection();
@@ -218,18 +218,18 @@ class PluginList
 					, "plugin-manager.list-download.disconnected"
 					, new Object[]{e.getMessage()});
 			Log.log (Log.ERROR, this, "CacheRemotePluginList: error", e);
-		}	
+		}
 		catch (Exception e)
 		{
 			Log.log (Log.ERROR, this, "CacheRemotePluginList: error", e);
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(out);
-			IOUtilities.closeQuietly(is);
+			IOUtilities.closeQuietly((Closeable)out);
+			IOUtilities.closeQuietly((Closeable)is);
 		}
 	}
-	
+
 	//{{{ addPlugin() method
 	void addPlugin(Plugin plugin)
 	{
diff --git a/org/gjt/sp/jedit/pluginmgr/PluginManager.java b/org/gjt/sp/jedit/pluginmgr/PluginManager.java
index 1d358cd..09935eb 100644
--- a/org/gjt/sp/jedit/pluginmgr/PluginManager.java
+++ b/org/gjt/sp/jedit/pluginmgr/PluginManager.java
@@ -1,9 +1,10 @@
 /*
  * PluginManager.java - Plugin manager window
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
- * Copyright (C) 2002 Kris Kopicki
+ * Copyright (C) 2002-2012 Slava Pestov, Matthieu Casanova, Kris Kopicki,
+ * 				Shlomy Reinstein, Alan Ezust
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -31,17 +32,22 @@ import java.awt.*;
 import org.gjt.sp.jedit.EditBus.EBHandler;
 import org.gjt.sp.jedit.msg.*;
 import org.gjt.sp.jedit.options.*;
+import org.gjt.sp.jedit.pluginmgr.PluginList.Branch;
+import org.gjt.sp.jedit.pluginmgr.PluginList.Dependency;
+import org.gjt.sp.jedit.pluginmgr.PluginList.Plugin;
 import org.gjt.sp.jedit.*;
+import org.gjt.sp.util.Log;
+import org.gjt.sp.util.StandardUtilities;
 import org.gjt.sp.util.Task;
 import org.gjt.sp.util.ThreadUtilities;
 //}}}
 
 /**
- * @version $Id: PluginManager.java 21092 2012-02-08 09:48:48Z kpouer $
+ * @version $Id: PluginManager.java 22967 2013-05-06 09:15:44Z kpouer $
  */
 public class PluginManager extends JFrame
 {
-	
+
 	//{{{ getInstance() method
 	/**
 	 * Returns the currently visible plugin manager window, or null.
@@ -96,8 +102,7 @@ public class PluginManager extends JFrame
 	{
 		if (instance == null)
 			instance = new PluginManager(parent);
-		else
-			instance.toFront();
+		instance.toFront();
 	} //}}}
 
 	//{{{ ok() method
@@ -140,7 +145,7 @@ public class PluginManager extends JFrame
 	//{{{ pluginRemoved() method
 	/**
 	 * A callback called by the @link ManagePanel} when a plugin is removed.
-	 * In that case, if the plugin had an update, the updated has to remove it,
+	 * In that case, if the plugin had an update, the updater has to remove it,
 	 * and the installer panel has to show the plugin again.
 	 */
 	void pluginRemoved()
@@ -161,7 +166,7 @@ public class PluginManager extends JFrame
 	private void init()
 	{
 		EditBus.addToBus(this);
-		
+
 
 		/* Setup panes */
 		JPanel content = new JPanel(new BorderLayout(12,12));
@@ -248,6 +253,8 @@ public class PluginManager extends JFrame
 			@Override
 			public void _run()
 			{
+				installer.loading();
+				updater.loading();
 				try
 				{
 					downloadingPluginList = true;
@@ -268,9 +275,72 @@ public class PluginManager extends JFrame
 				});
 			}
 		});
+
+
+
 	} //}}}
 
-	//{{{ processKeyEvent() method
+	//{{{ checkForObsoletePlugins()
+	/** Checks for obsolete plugins, and marks them as unsupported.
+	 *  <p>
+	 *  An obsolete plugin branch can be marked as inactive, or
+	 *  an individual release can have a max jEdit version that is 
+	 *  lower than the running version. If no later version/branch exists
+	 *  that supports this jEdit version, the plugin is unsupported.
+	 * @since jEdit 5.1pre1
+	 * @author Alan Ezust
+    */
+	public void checkForObsoletePlugins()
+	{
+		if ((pluginList == null) || (pluginList.plugins == null)) return;
+		// for each plugin that is installed:			
+		for (PluginJAR jar: jEdit.getPluginJARs())
+		{
+			EditPlugin eplugin = jar.getPlugin();
+			if (eplugin == null) continue;
+			String installedVersion = jEdit.getProperty("plugin." + eplugin.getClassName() + ".version");
+			// find corresponding entry in pluginList:
+			for (Plugin plugin: pluginList.plugins)
+				if (MiscUtilities.pathsEqual(plugin.jar, MiscUtilities.getFileName(jar.getPath())))
+				{
+					// find the branch with latest version greater than or equal to installedVersion
+					Branch lastBranch = null;
+					String latestVersion = "0";
+					for (Branch branch: plugin.branches)
+						if (StandardUtilities.compareStrings(branch.version, installedVersion, false) >= 0) 
+							if (StandardUtilities.compareStrings(branch.version, latestVersion, false) >= 0) 
+							{
+								latestVersion = branch.version;
+								lastBranch = branch;
+							}					
+					if (lastBranch != null) 
+						if (lastBranch.obsolete) disablePlugin(jar, plugin.name);	
+						else for (Dependency dep: lastBranch.deps)
+							// if there is a max jEdit version, check if we're higher:
+							if (dep.what.equals("jedit") && (dep.to != null))
+								if (StandardUtilities.compareStrings(jEdit.getBuild(), dep.to, false) > 0)
+									disablePlugin(jar, plugin.name);
+					
+				}
+		}
+	} //}}}
+
+	//{{{ disablePlugin()
+	private void disablePlugin(PluginJAR jar, String name) 
+	{
+		Log.log(Log.ERROR, this, "Plugin: " + name + 
+			" is not supported on this version of jEdit! ");
+		if (!jEdit.getBooleanProperty("plugin-manager.disable-obsolete", true)) return;
+		jEdit.removePluginJAR(jar,false);
+		String jarName = MiscUtilities.getFileName(jar.getPath());
+		// Stop it from getting loaded on startup:
+		jEdit.setBooleanProperty("plugin-blacklist."+ jarName, true);
+		// show as 'Unsupported' in Manage Panel:
+		jEdit.setBooleanProperty("plugin." + jarName + ".disabled", true);
+		jEdit.propertiesChanged();		
+	}//}}}
+	
+	//{{{ pluginListUpdated() method
 	private void pluginListUpdated()
 	{
 		Component selected = tabPane.getSelectedComponent();
@@ -279,6 +349,7 @@ public class PluginManager extends JFrame
 			installer.updateModel();
 			updater.updateModel();
 		}
+		checkForObsoletePlugins();
 	} //}}}
 
 	//{{{ processKeyEvent() method
diff --git a/org/gjt/sp/jedit/pluginmgr/PluginManagerProgress.java b/org/gjt/sp/jedit/pluginmgr/PluginManagerProgress.java
index ae7ac8b..938e9e8 100644
--- a/org/gjt/sp/jedit/pluginmgr/PluginManagerProgress.java
+++ b/org/gjt/sp/jedit/pluginmgr/PluginManagerProgress.java
@@ -1,6 +1,6 @@
 /*
  * PluginManagerProgress.java - Plugin download progress meter
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2001 Slava Pestov
diff --git a/org/gjt/sp/jedit/pluginmgr/Roster.java b/org/gjt/sp/jedit/pluginmgr/Roster.java
index 91ac610..ccc10be 100644
--- a/org/gjt/sp/jedit/pluginmgr/Roster.java
+++ b/org/gjt/sp/jedit/pluginmgr/Roster.java
@@ -37,7 +37,7 @@ import static org.gjt.sp.jedit.io.FileVFS.recursiveDelete;
 //}}}
 
 /**
- * @author $Id: Roster.java 21750 2012-06-02 12:34:56Z jarekczek $
+ * @author $Id: Roster.java 22357 2012-10-13 04:58:01Z ezust $
  */
 class Roster
 {
@@ -240,7 +240,7 @@ class Roster
 		private void unloadPluginJAR(PluginJAR jar)
 		{
 			String[] dependents = jar.getDependentPlugins();
-			for (String path: dependents) 
+			for (String path: dependents)
 			{
 				PluginJAR _jar = jEdit.getPluginJAR(path);
 				if(_jar != null)
@@ -337,7 +337,7 @@ class Roster
 								throw new ZipException("Entry "
 									+ entry.getName() + " from archive "
 									+ zipFile.getName()
-									+ " could not be processed."); 
+									+ " could not be processed.");
 							out = new FileOutputStream(file);
 							IOUtilities.copyStream(4096,
 								null,
@@ -346,8 +346,8 @@ class Roster
 						}
 						finally
 						{
-							IOUtilities.closeQuietly(in);
-							IOUtilities.closeQuietly(out);
+							IOUtilities.closeQuietly((Closeable)in);
+							IOUtilities.closeQuietly((Closeable)out);
 						}
 						if(file.getName().toLowerCase().endsWith(".jar"))
 							toLoad.add(file.getPath());
@@ -415,7 +415,7 @@ class Roster
 				String host = jEdit.getProperty("plugin-manager.mirror.id");
 				if (host == null || host.equals(MirrorList.Mirror.NONE))
 					host = "default";
-				
+
 				String path = MiscUtilities.constructPath(getDownloadDir(),fileName);
 				URLConnection conn = new URL(url).openConnection();
 				progress.setStatus(jEdit.getProperty("plugin-manager.progress",new String[] {fileName, host}));
@@ -430,10 +430,10 @@ class Roster
 				}
 				finally
 				{
-					IOUtilities.closeQuietly(in);
-					IOUtilities.closeQuietly(out);
+					IOUtilities.closeQuietly((Closeable)in);
+					IOUtilities.closeQuietly((Closeable)out);
 				}
-				
+
 				return path;
 			}
 			catch(InterruptedIOException iio)
diff --git a/org/gjt/sp/jedit/pluginmgr/plugins.dtd b/org/gjt/sp/jedit/pluginmgr/plugins.dtd
index b937768..718bd9a 100644
--- a/org/gjt/sp/jedit/pluginmgr/plugins.dtd
+++ b/org/gjt/sp/jedit/pluginmgr/plugins.dtd
@@ -11,14 +11,14 @@
 	NAME CDATA #REQUIRED >
 <!ELEMENT PLUGIN_SET_ENTRY ( #PCDATA ) >
 
-<!ELEMENT PLUGIN ( DESCRIPTION, AUTHOR+, BRANCH+ ) >
+<!ELEMENT PLUGIN ( AUTHOR+, DESCRIPTION, BRANCH* ) >
 <!ATTLIST PLUGIN
 	JAR CDATA #REQUIRED
 	NAME CDATA #REQUIRED >
 
 <!ELEMENT AUTHOR ( #PCDATA ) >
 
-<!ELEMENT BRANCH ( DOWNLOAD, DOWNLOAD_SOURCE, ( DEPEND+ ) ) >
+<!ELEMENT BRANCH ( (DOWNLOAD, DOWNLOAD_SOURCE, ( DEPEND+ ))? ) >
 <!ATTLIST BRANCH
 	VERSION CDATA #REQUIRED
 	DATE CDATA #REQUIRED
diff --git a/org/gjt/sp/jedit/print/BufferPrintable.java b/org/gjt/sp/jedit/print/BufferPrintable.java
index ca6ccd7..72a90a0 100644
--- a/org/gjt/sp/jedit/print/BufferPrintable.java
+++ b/org/gjt/sp/jedit/print/BufferPrintable.java
@@ -1,6 +1,6 @@
 /*
  * BufferPrintable.java - Printable implementation
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2003 Slava Pestov
@@ -40,7 +40,7 @@ import org.gjt.sp.util.*;
 //}}}
 
 /**
- * @version $Id: BufferPrintable.java 18832 2010-10-23 09:54:46Z kpouer $
+ * @version $Id: BufferPrintable.java 21831 2012-06-18 22:54:17Z ezust $
  */
 class BufferPrintable implements Printable
 {
diff --git a/org/gjt/sp/jedit/print/BufferPrinter1_3.java b/org/gjt/sp/jedit/print/BufferPrinter1_3.java
index 9a9fd51..bd790b2 100644
--- a/org/gjt/sp/jedit/print/BufferPrinter1_3.java
+++ b/org/gjt/sp/jedit/print/BufferPrinter1_3.java
@@ -1,6 +1,6 @@
 /*
  * BufferPrinter1_3.java - Main class that controls printing
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001 Slava Pestov
@@ -83,7 +83,7 @@ public class BufferPrinter1_3
 	public static void print(final View view, final Buffer buffer, boolean selection)
 	{
 		job = getPrintJob();
-		job.setJobName(MiscUtilities.abbreviate(buffer.getPath()));
+		job.setJobName(MiscUtilities.abbreviateView(buffer.getPath()));
 		boolean header = jEdit.getBooleanProperty("print.header");
 		boolean footer = jEdit.getBooleanProperty("print.footer");
 		boolean lineNumbers = jEdit.getBooleanProperty("print.lineNumbers");
diff --git a/org/gjt/sp/jedit/print/BufferPrinter1_4.java b/org/gjt/sp/jedit/print/BufferPrinter1_4.java
index d87ee4b..ad54d95 100644
--- a/org/gjt/sp/jedit/print/BufferPrinter1_4.java
+++ b/org/gjt/sp/jedit/print/BufferPrinter1_4.java
@@ -1,6 +1,6 @@
 /*
  * BufferPrinter1_4.java - Main class that controls printing
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001 Slava Pestov
@@ -29,6 +29,7 @@ import javax.print.attribute.standard.*;
 import java.awt.print.*;
 import java.awt.*;
 import java.io.*;
+
 import org.gjt.sp.jedit.*;
 import org.gjt.sp.util.Log;
 //}}}
@@ -51,15 +52,23 @@ public class BufferPrinter1_4
 
 			if (filePrintSpec.exists())
 			{
+				FileInputStream fileIn;
+				ObjectInputStream obIn = null;
 				try
 				{
-					FileInputStream fileIn = new FileInputStream(filePrintSpec);
-					ObjectInputStream obIn = new ObjectInputStream(fileIn);
+					fileIn = new FileInputStream(filePrintSpec);
+					obIn = new ObjectInputStream(fileIn);
 					format = (HashPrintRequestAttributeSet)obIn.readObject();
 				}
 				catch(Exception e)
 				{
 					Log.log(Log.ERROR,BufferPrinter1_4.class,e);
+				} finally
+				{
+					try
+					{
+						obIn.close();
+					} catch (IOException e) {}
 				}
 				//for backwards compatibility, the color variable is stored also as a property
 				if(jEdit.getBooleanProperty("print.color"))
@@ -86,7 +95,7 @@ public class BufferPrinter1_4
 	//{{{ print() method
 	public static void print(final View view, final Buffer buffer, boolean selection)
 	{
-		job = getPrintJob(MiscUtilities.abbreviate(buffer.getPath()));
+		job = getPrintJob(MiscUtilities.abbreviateView(buffer.getPath()));
 
 		boolean header = jEdit.getBooleanProperty("print.header");
 		boolean footer = jEdit.getBooleanProperty("print.footer");
@@ -168,10 +177,12 @@ public class BufferPrinter1_4
 			settings, "printspec");
 		File filePrintSpec = new File(printSpecPath);
 
+		FileOutputStream fileOut;
+		ObjectOutputStream obOut = null;
 		try
 		{
-			FileOutputStream fileOut=new FileOutputStream(filePrintSpec);
-			ObjectOutputStream obOut=new ObjectOutputStream(fileOut);
+			fileOut = new FileOutputStream(filePrintSpec);
+			obOut = new ObjectOutputStream(fileOut);
 			obOut.writeObject(format);
 			//for backwards compatibility, the color variable is stored also as a property
 			Chromaticity cc=(Chromaticity)format.get(Chromaticity.class);
@@ -182,6 +193,12 @@ public class BufferPrinter1_4
 		catch(Exception e)
 		{
 			e.printStackTrace();
+		} finally {
+			if(obOut != null)
+				try
+				{
+					obOut.close();
+				} catch (IOException e) {}
 		}
 	}
 	//}}}
diff --git a/org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java b/org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java
index 8c8e116..5f5d98b 100644
--- a/org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java
+++ b/org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java
@@ -1,6 +1,6 @@
 /*
  * PluginResURLConnection.java - jEdit plugin resource URL connection
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2000, 2001 Slava Pestov
@@ -34,8 +34,13 @@ import org.gjt.sp.jedit.MiscUtilities;
 import org.gjt.sp.jedit.PluginJAR;
 import org.gjt.sp.jedit.jEdit;
 
+import org.gjt.sp.util.Log;
+//}}}
+
+//{{{ class PluginResURLConnection
 public class PluginResURLConnection extends URLConnection
 {
+	//{{{ constructor
 	public PluginResURLConnection(URL url)
 		throws IOException
 	{
@@ -63,8 +68,9 @@ public class PluginResURLConnection extends URLConnection
 
 		if(plugin != null && resource.startsWith("/"))
 			resource = resource.substring(1);
-	}
+	}//}}}
 
+	//{{{ connect()
 	public void connect() throws IOException
 	{
 		if(!connected)
@@ -75,6 +81,7 @@ public class PluginResURLConnection extends URLConnection
 			}
 			else
 			{
+				boolean pluginFoundInPluginJARs = false;
 				PluginJAR[] plugins = jEdit.getPluginJARs();
 				for(int i = 0; i < plugins.length; i++)
 				{
@@ -82,10 +89,16 @@ public class PluginResURLConnection extends URLConnection
 					String jarName =MiscUtilities.getFileName(jar.getPath()).toLowerCase(); 
 					if(plugin.equalsIgnoreCase(jarName))
 					{
+						pluginFoundInPluginJARs = true;
 						in = jar.getClassLoader().getResourceAsStream(resource);
 						break;
 					}
 				}
+				if(!pluginFoundInPluginJARs){
+					Log.log(Log.DEBUG, PluginResURLConnection.class,
+							"reading resource from not loaded plugin "
+							+" => will always fail !");
+				}
 			}
 
 			if((in == null) && (plugin == null))
@@ -98,15 +111,17 @@ public class PluginResURLConnection extends URLConnection
 			}
 			connected = true;
 		}
-	}
+	}//}}}
 
+	//{{{ getInputStream()
 	public InputStream getInputStream()
 		throws IOException
 	{
 		connect();
 		return in;
-	}
+	}//}}}
 
+	//{{{ getHeaderField()
 	public String getHeaderField(String name)
 	{
 		if(name.equals("content-type"))
@@ -128,10 +143,11 @@ public class PluginResURLConnection extends URLConnection
 		}
 		else
 			return null;
-	}
+	}//}}}
 
-	// private members
+	//{{{ private members
 	private InputStream in;
 	private String plugin;
 	private String resource;
-}
+	//}}}
+}//}}}
diff --git a/org/gjt/sp/jedit/search/AllBufferSet.java b/org/gjt/sp/jedit/search/AllBufferSet.java
index 19cbb53..268a5ac 100644
--- a/org/gjt/sp/jedit/search/AllBufferSet.java
+++ b/org/gjt/sp/jedit/search/AllBufferSet.java
@@ -1,6 +1,6 @@
 /*
  * AllBufferSet.java - All buffer matcher
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2000, 2001 Slava Pestov
@@ -33,23 +33,32 @@ import org.gjt.sp.util.StandardUtilities;
 //}}}
 
 /**
- * A file set for searching all open buffers.
+ * A file set for searching all open buffers in a view.
  * @author Slava Pestov
- * @version $Id: AllBufferSet.java 15834 2009-08-01 05:35:05Z shlomy $
+ * @version $Id: AllBufferSet.java 22151 2012-09-04 04:01:41Z ezust $
  */
 public class AllBufferSet extends BufferListSet
 {
 	//{{{ AllBufferSet constructor
 	/**
-	 * Creates a new all buffer set.
+	 * Creates a view buffer set.
 	 * @param glob The filename glob
-	 * @since jEdit 2.7pre3
+	 * @param view The view to check for open buffers
+	 * @since jEdit 5.1pre1
 	 */
-	public AllBufferSet(String glob)
+	public AllBufferSet(String glob, View view)
 	{
 		this.glob = glob;
+		this.view = view;
 	} //}}}
-
+	
+	//{{{ getView() method
+	/** @since jEdit 5.1pre1 */
+	public View getView() 
+	{
+		return view;
+	}//}}}
+	
 	//{{{ getFileFilter() method
 	/**
 	 * Returns the filename filter.
@@ -68,19 +77,20 @@ public class AllBufferSet extends BufferListSet
 	@Override
 	public String getCode()
 	{
-		return "new AllBufferSet(\"" + StandardUtilities.charsToEscapes(glob)
-			+ "\")";
+		return "new AllBufferSet(\"" + StandardUtilities.charsToEscapes(glob) 
+		+ "\", view)";
 	} //}}}
 
 	//{{{ Instance variables
 	private String glob;
+	private View view;
 	//}}}
 
 	//{{{ _getFiles() method
 	@Override
 	protected String[] _getFiles(Component comp)
 	{
-		Buffer[] buffers = jEdit.getBuffers();
+		Buffer[] buffers = view.getBuffers();
 		List<String> returnValue = new ArrayList<String>(buffers.length);
 
 		Pattern filter;
@@ -91,7 +101,7 @@ public class AllBufferSet extends BufferListSet
 		}
 		catch(Exception e)
 		{
-			Log.log(Log.ERROR,this,e);
+			Log.log(Log.ERROR,this, "Error compiling Glob Pattern: " + glob, e);
 			return null;
 		}
 
diff --git a/org/gjt/sp/jedit/search/BoyerMooreSearchMatcher.java b/org/gjt/sp/jedit/search/BoyerMooreSearchMatcher.java
index 18da04c..f95d528 100644
--- a/org/gjt/sp/jedit/search/BoyerMooreSearchMatcher.java
+++ b/org/gjt/sp/jedit/search/BoyerMooreSearchMatcher.java
@@ -1,7 +1,7 @@
 /*
  * BoyerMooreSearchMatcher.java - Literal pattern String matcher utilizing the
  *         Boyer-Moore algorithm
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2000 mike dillon
@@ -27,7 +27,7 @@ package org.gjt.sp.jedit.search;
 
 /**
  * Implements literal search using the Boyer-Moore algorithm.
- * @version $Id: BoyerMooreSearchMatcher.java 22393 2012-10-19 01:25:28Z ezust $
+ * @version $Id: BoyerMooreSearchMatcher.java 22941 2013-04-22 11:06:59Z thomasmey $
  */
 public class BoyerMooreSearchMatcher extends SearchMatcher
 {
@@ -72,7 +72,7 @@ public class BoyerMooreSearchMatcher extends SearchMatcher
 	@Override
 	public SearchMatcher.Match nextMatch(CharSequence text,
 		boolean start, boolean end, boolean firstTime,
-		boolean reverse)
+		boolean reverse) throws InterruptedException
 	{
 		int pos = match(text,reverse);
 
@@ -110,11 +110,15 @@ public class BoyerMooreSearchMatcher extends SearchMatcher
 	 *  algorithm may be found on Moore's website at:
 	 *
 	 *   http://www.cs.utexas.edu/users/moore/best-ideas/string-searching/
+	 * @throws InterruptedException 
 	 *
 	 * @since jEdit 4.3pre5
 	 */
-	public int match(CharSequence text, boolean reverse)
+	public int match(CharSequence text, boolean reverse) throws InterruptedException
 	{
+		if(Thread.interrupted())
+			throw new InterruptedException();
+
 		//{{{
 		// lazily create skip and suffix arrays for either the
 		// search pattern, or the reversed search pattern
@@ -171,6 +175,9 @@ public class BoyerMooreSearchMatcher extends SearchMatcher
 		SEARCH:
 		while (anchor + pattern_end < text.length())
 		{
+			if(Thread.interrupted())
+				throw new InterruptedException();
+
 			for (pos = pattern_end; pos >= 0; --pos)
 			{
 				ch = text.charAt(pos + anchor);
diff --git a/org/gjt/sp/jedit/search/BufferListSet.java b/org/gjt/sp/jedit/search/BufferListSet.java
index 6081a3b..daabfac 100644
--- a/org/gjt/sp/jedit/search/BufferListSet.java
+++ b/org/gjt/sp/jedit/search/BufferListSet.java
@@ -1,6 +1,6 @@
 /*
  * BufferListSet.java - Buffer list matcher
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2004 Slava Pestov
@@ -32,7 +32,7 @@ import org.gjt.sp.util.StandardUtilities;
 /**
  * A file set for searching a user-specified list of buffers.
  * @author Slava Pestov
- * @version $Id: BufferListSet.java 21027 2012-01-30 21:41:40Z kpouer $
+ * @version $Id: BufferListSet.java 22454 2012-11-10 11:15:08Z thomasmey $
  */
 public abstract class BufferListSet implements SearchFileSet
 {
@@ -99,7 +99,7 @@ public abstract class BufferListSet implements SearchFileSet
 	//{{{ getCode() method
 	public String getCode()
 	{
-		// not supported for arbitriary filesets
+		// not supported for arbitrary filesets
 		return null;
 	} //}}}
 
diff --git a/org/gjt/sp/jedit/search/CurrentBufferSet.java b/org/gjt/sp/jedit/search/CurrentBufferSet.java
index 810c14a..8bee143 100644
--- a/org/gjt/sp/jedit/search/CurrentBufferSet.java
+++ b/org/gjt/sp/jedit/search/CurrentBufferSet.java
@@ -1,6 +1,6 @@
 /*
  * CurrentBufferSet.java - Current buffer matcher
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2001 Slava Pestov
@@ -27,7 +27,7 @@ import org.gjt.sp.jedit.*;
 /**
  * A file set for searching the current buffer.
  * @author Slava Pestov
- * @version $Id: CurrentBufferSet.java 20610 2011-12-11 15:46:35Z evanpw $
+ * @version $Id: CurrentBufferSet.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class CurrentBufferSet implements SearchFileSet
 {
diff --git a/org/gjt/sp/jedit/search/DirectoryListSet.java b/org/gjt/sp/jedit/search/DirectoryListSet.java
index c19b3a9..041be9c 100644
--- a/org/gjt/sp/jedit/search/DirectoryListSet.java
+++ b/org/gjt/sp/jedit/search/DirectoryListSet.java
@@ -1,6 +1,6 @@
 /*
  * DirectoryListSet.java - Directory list matcher
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2000, 2001 Slava Pestov
@@ -23,19 +23,17 @@
 package org.gjt.sp.jedit.search;
 
 //{{{ Imports
-import javax.swing.SwingUtilities;
 import java.awt.Component;
 import java.io.*;
 import org.gjt.sp.jedit.io.*;
 import org.gjt.sp.jedit.*;
-import org.gjt.sp.util.Log;
 import org.gjt.sp.util.StandardUtilities;
 //}}}
 
 /**
  * Recursive directory search.
  * @author Slava Pestov
- * @version $Id: DirectoryListSet.java 16365 2009-10-20 05:13:52Z vanza $
+ * @version $Id: DirectoryListSet.java 22454 2012-11-10 11:15:08Z thomasmey $
  */
 public class DirectoryListSet extends BufferListSet
 {
@@ -45,8 +43,6 @@ public class DirectoryListSet extends BufferListSet
 		this.directory = directory;
 		this.glob = glob;
 		this.recurse = recurse;
-		this.skipBinary = jEdit.getBooleanProperty("search.skipBinary.toggle");
-		this.skipHidden = jEdit.getBooleanProperty("search.skipHidden.toggle");
 	} //}}}
 
 
@@ -112,38 +108,12 @@ public class DirectoryListSet extends BufferListSet
 	@Override
 	protected String[] _getFiles(final Component comp)
 	{
+		boolean skipBinary, skipHidden;
 		skipBinary = jEdit.getBooleanProperty("search.skipBinary.toggle");
 		skipHidden = jEdit.getBooleanProperty("search.skipHidden.toggle");
 		final VFS vfs = VFSManager.getVFSForPath(directory);
 		Object session;
-		if(SwingUtilities.isEventDispatchThread())
-		{
-			session = vfs.createVFSSession(directory,comp);
-		}
-		else
-		{
-			final Object[] returnValue = new Object[1];
-
-			try
-			{
-				SwingUtilities.invokeAndWait(new Runnable()
-				{
-					public void run()
-					{
-						returnValue[0] = vfs.createVFSSession(directory,comp);
-					}
-				});
-			}
-			catch(Exception e)
-			{
-				Log.log(Log.ERROR,this,e);
-			}
-
-			session = returnValue[0];
-		}
-
-		if(session == null)
-			return null;
+		session = vfs.createVFSSessionSafe(directory, comp);
 
 		try
 		{
@@ -168,7 +138,5 @@ public class DirectoryListSet extends BufferListSet
 	private String directory;
 	private String glob;
 	private boolean recurse;
-	private boolean skipHidden;
-	private boolean skipBinary;
 	//}}}
 }
diff --git a/org/gjt/sp/jedit/search/HyperSearchFileNode.java b/org/gjt/sp/jedit/search/HyperSearchFileNode.java
index 8756fe4..fc66862 100644
--- a/org/gjt/sp/jedit/search/HyperSearchFileNode.java
+++ b/org/gjt/sp/jedit/search/HyperSearchFileNode.java
@@ -1,6 +1,6 @@
 /*
  * HyperSearchFileNode.java - HyperSearch file node
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
@@ -31,7 +31,7 @@ import org.gjt.sp.jedit.jEdit;
 /**
  * HyperSearch results window.
  * @author Slava Pestov
- * @version $Id: HyperSearchFileNode.java 13284 2008-08-12 18:41:18Z k_satoda $
+ * @version $Id: HyperSearchFileNode.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class HyperSearchFileNode implements HyperSearchNode
 {
diff --git a/org/gjt/sp/jedit/search/HyperSearchFolderNode.java b/org/gjt/sp/jedit/search/HyperSearchFolderNode.java
index ad81d5d..74a4065 100644
--- a/org/gjt/sp/jedit/search/HyperSearchFolderNode.java
+++ b/org/gjt/sp/jedit/search/HyperSearchFolderNode.java
@@ -1,6 +1,6 @@
 /*
  * HyperSearchFolderNode - HyperSearch Folder Tree Node
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
diff --git a/org/gjt/sp/jedit/search/HyperSearchNode.java b/org/gjt/sp/jedit/search/HyperSearchNode.java
index 274575d..ec91e88 100644
--- a/org/gjt/sp/jedit/search/HyperSearchNode.java
+++ b/org/gjt/sp/jedit/search/HyperSearchNode.java
@@ -1,6 +1,6 @@
 /*
  * HyperSearchNode.java - HyperSearch node
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
diff --git a/org/gjt/sp/jedit/search/HyperSearchOperationNode.java b/org/gjt/sp/jedit/search/HyperSearchOperationNode.java
index 904846c..2447bb1 100644
--- a/org/gjt/sp/jedit/search/HyperSearchOperationNode.java
+++ b/org/gjt/sp/jedit/search/HyperSearchOperationNode.java
@@ -1,6 +1,6 @@
 /*
  * HyperSearchOperationNode.java - Top result node of a HyperSearch request
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 1999, 2000, 2001, 2002 Slava Pestov
@@ -39,7 +39,7 @@ import javax.swing.tree.TreePath;
 
 /**
  * @author Slava Pestov
- * @version $Id: HyperSearchOperationNode.java 19386 2011-02-24 11:06:57Z kpouer $
+ * @version $Id: HyperSearchOperationNode.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class HyperSearchOperationNode
 {
diff --git a/org/gjt/sp/jedit/search/HyperSearchRequest.java b/org/gjt/sp/jedit/search/HyperSearchRequest.java
index d14b896..69cb1db 100644
--- a/org/gjt/sp/jedit/search/HyperSearchRequest.java
+++ b/org/gjt/sp/jedit/search/HyperSearchRequest.java
@@ -1,6 +1,6 @@
 /*
  * HyperSearchRequest.java - HyperSearch request, run in I/O thread
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 1999, 2000, 2001, 2002 Slava Pestov
@@ -38,7 +38,7 @@ import org.gjt.sp.util.*;
 /**
  * HyperSearch results window.
  * @author Slava Pestov
- * @version $Id: HyperSearchRequest.java 19386 2011-02-24 11:06:57Z kpouer $
+ * @version $Id: HyperSearchRequest.java 22949 2013-04-23 18:53:15Z thomasmey $
  */
 class HyperSearchRequest extends Task
 {
@@ -103,10 +103,8 @@ class HyperSearchRequest extends Task
 				int maxResults = jEdit.getIntegerProperty("hypersearch.maxWarningResults");
 				for(int i = 0; i < files.length; i++)
 				{
-					if(jEdit.getBooleanProperty("hyperSearch-stopButton") ||
-						Thread.currentThread().isInterrupted())
+					if(Thread.currentThread().isInterrupted())
 					{
-						jEdit.setTemporaryProperty("hyperSearch-stopButton", "false");
 						Log.log(Log.MESSAGE, this, "Search stopped by user action (stop button)");
 						break;
 					}
@@ -138,7 +136,13 @@ class HyperSearchRequest extends Task
 
 					Buffer buffer = jEdit.openTemporary(null,null,file,false);
 					if(buffer != null)
+					{
+						// Wait for the buffer to load
+						if(!buffer.isLoaded())
+							TaskManager.instance.waitForIoTasks();
+
 						resultCount += doHyperSearch(buffer, 0, buffer.getLength());
+					}
 				}
 				Log.log(Log.MESSAGE, this, resultCount +" OCCURENCES");
 			}
@@ -222,7 +226,10 @@ class HyperSearchRequest extends Task
 	private int doHyperSearch(Buffer buffer, int start, int end)
 		throws Exception
 	{
-		setCancellable(false);
+		if(matcher instanceof BoyerMooreSearchMatcher)
+			setCancellable(true);
+		else
+			setCancellable(false);
 
 		HyperSearchFileNode hyperSearchFileNode = new HyperSearchFileNode(buffer.getPath());
 		DefaultMutableTreeNode bufferNode = new DefaultMutableTreeNode(hyperSearchFileNode);
@@ -241,8 +248,12 @@ class HyperSearchRequest extends Task
 	private int doHyperSearch(Buffer buffer, int start, int end,
 		DefaultMutableTreeNode bufferNode)
 	{
-		String noWordSep = (String) buffer.getMode().getProperty("noWordSep");
-		matcher.setNoWordSep(noWordSep);
+		if(matcher.wholeWord)
+		{
+			buffer.setMode();
+			String noWordSep = buffer.getStringProperty("noWordSep");
+			matcher.setNoWordSep(noWordSep);
+		}
 		int resultCount = 0;
 		JEditTextArea textArea = jEdit.getActiveView().getTextArea();
 		int caretLine = textArea.getBuffer() == buffer ? textArea.getCaretLine() : -1;
@@ -261,10 +272,15 @@ class HyperSearchRequest extends Task
 				boolean startOfLine = buffer.getLineStartOffset(
 					buffer.getLineOfOffset(offset)) == offset;
 
-				SearchMatcher.Match match = matcher.nextMatch(
-					buffer.getSegment(offset, end - offset),
-					startOfLine,endOfLine,counter == 0,
-					false);
+				SearchMatcher.Match match = null;
+				try {
+					match = matcher.nextMatch(
+						buffer.getSegment(offset, end - offset),
+						startOfLine,endOfLine,counter == 0,
+						false);
+				} catch (InterruptedException e) {
+					Thread.currentThread().interrupt();
+				}
 				if(match == null)
 					break;
 
diff --git a/org/gjt/sp/jedit/search/HyperSearchResult.java b/org/gjt/sp/jedit/search/HyperSearchResult.java
index 36e5878..37b9530 100644
--- a/org/gjt/sp/jedit/search/HyperSearchResult.java
+++ b/org/gjt/sp/jedit/search/HyperSearchResult.java
@@ -1,6 +1,6 @@
 /*
  * HyperSearchResult.java - HyperSearch result
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/search/HyperSearchResults.java b/org/gjt/sp/jedit/search/HyperSearchResults.java
index 5e8ce33..f619f9c 100644
--- a/org/gjt/sp/jedit/search/HyperSearchResults.java
+++ b/org/gjt/sp/jedit/search/HyperSearchResults.java
@@ -1,6 +1,6 @@
 /*
  * HyperSearchResults.java - HyperSearch results
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 1999, 2000, 2001 Slava Pestov
@@ -44,12 +44,13 @@ import org.gjt.sp.jedit.*;
 import org.gjt.sp.util.EnhancedTreeCellRenderer;
 import org.gjt.sp.util.HtmlUtilities;
 import org.gjt.sp.util.SyntaxUtilities;
+import org.gjt.sp.util.TaskManager;
 //}}}
 
 /**
  * HyperSearch results window.
  * @author Slava Pestov
- * @version $Id: HyperSearchResults.java 20577 2011-12-08 09:19:23Z kpouer $
+ * @version $Id: HyperSearchResults.java 22942 2013-04-22 11:27:52Z thomasmey $
  */
 public class HyperSearchResults extends JPanel implements DefaultFocusComponent
 {
@@ -531,7 +532,7 @@ public class HyperSearchResults extends JPanel implements DefaultFocusComponent
 			}
 			else if(source == stop)
 			{
-				jEdit.setTemporaryProperty("hyperSearch-stopButton", "true");
+				TaskManager.instance.cancelTasksByClass(HyperSearchRequest.class);
 			}
 		}
 	} //}}}
@@ -584,13 +585,26 @@ public class HyperSearchResults extends JPanel implements DefaultFocusComponent
 				i += 2;
 			else
 				i = 0;
-			Match m;
+			Match m = null;
 			List<Integer> matches = new ArrayList<Integer>();
-			while ((m = matcher.nextMatch(s.substring(i), true, true, true, false)) != null)
+			try {
+				m = matcher.nextMatch(s.substring(i), true, true, true, false);
+			} catch (InterruptedException e) {
+				Thread.currentThread().interrupt();
+			}
+			while (m != null)
 			{
 				matches.add(i + m.start);
 				matches.add(i + m.end);
 				i += m.end;
+
+				try {
+					m = matcher.nextMatch(s.substring(i), true, true, true, false);
+				} catch (InterruptedException e) {
+					Thread.currentThread().interrupt();
+				} finally {
+					m = null;
+				}
 			}
 			return HtmlUtilities.highlightString(s, styleTag, matches);
 		}
diff --git a/org/gjt/sp/jedit/search/HyperSearchTreeNodeCallback.java b/org/gjt/sp/jedit/search/HyperSearchTreeNodeCallback.java
index 7a0b3ae..e3580e9 100644
--- a/org/gjt/sp/jedit/search/HyperSearchTreeNodeCallback.java
+++ b/org/gjt/sp/jedit/search/HyperSearchTreeNodeCallback.java
@@ -1,6 +1,6 @@
 /*
  * HyperSearchTreeNodeCallback - Callback interface for recursive tree traversal
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 1999, 2000, 2001, 2002 Slava Pestov
diff --git a/org/gjt/sp/jedit/search/SearchAndReplace.java b/org/gjt/sp/jedit/search/SearchAndReplace.java
index 83a3b78..27b15e6 100644
--- a/org/gjt/sp/jedit/search/SearchAndReplace.java
+++ b/org/gjt/sp/jedit/search/SearchAndReplace.java
@@ -1,6 +1,6 @@
 /*
  * SearchAndReplace.java - Search and replace
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2004 Slava Pestov
@@ -31,7 +31,6 @@ import javax.swing.JOptionPane;
 import org.gjt.sp.jedit.*;
 import org.gjt.sp.jedit.buffer.JEditBuffer;
 import org.gjt.sp.jedit.gui.TextAreaDialog;
-import org.gjt.sp.jedit.io.VFSManager;
 import org.gjt.sp.jedit.msg.PositionChanging;
 import org.gjt.sp.jedit.msg.SearchSettingsChanged;
 import org.gjt.sp.jedit.textarea.*;
@@ -64,7 +63,7 @@ import org.gjt.sp.util.*;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: SearchAndReplace.java 21996 2012-08-13 23:21:06Z ezust $
+ * @version $Id: SearchAndReplace.java 22949 2013-04-23 18:53:15Z thomasmey $
  */
 public class SearchAndReplace
 {
@@ -481,7 +480,7 @@ public class SearchAndReplace
 			record(view,"find(view)",false,true);
 
 			boolean repeat = false;
-loop:			for(;;)
+loop:		for(;;)
 			{
 				while(path != null)
 				{
@@ -510,7 +509,7 @@ loop:			for(;;)
 
 					// Wait for the buffer to load
 					if(!buffer.isLoaded())
-						VFSManager.waitForRequests();
+						TaskManager.instance.waitForIoTasks();
 
 					int start;
 
@@ -658,14 +657,17 @@ loop:			for(;;)
 			endOfLine = true;
 		}
 
-		String noWordSep = (String) buffer.getMode().getProperty("noWordSep");
-		matcher.setNoWordSep(noWordSep);
+		if(matcher.wholeWord)
+		{
+			String noWordSep = buffer.getStringProperty("noWordSep");
+			matcher.setNoWordSep(noWordSep);
+		}
 		SearchMatcher.Match match = matcher.nextMatch(text,
 			startOfLine,endOfLine,firstTime,reverse);
 		if(match != null)
 		{
 			jEdit.commitTemporary(buffer);
-			view.setBuffer(buffer,true);
+			view.setBuffer(buffer);
 			JEditTextArea textArea = view.getTextArea();
 
 			if(reverse)
@@ -892,7 +894,7 @@ loop:			for(;;)
 			initReplace();
 
 			String path = fileset.getFirstFile(view);
-loop:			while(path != null)
+loop:		while(path != null)
 			{
 				Buffer buffer = jEdit.openTemporary(
 					view,null,path,false);
@@ -912,7 +914,7 @@ loop:			while(path != null)
 
 				// Wait for buffer to finish loading
 				if(buffer.isPerformingIO())
-					VFSManager.waitForRequests();
+					TaskManager.instance.waitForIoTasks();
 
 				if(!buffer.isEditable())
 					continue loop;
@@ -1194,15 +1196,18 @@ loop:			while(path != null)
 		boolean smartCaseReplace)
 		throws Exception
 	{
-		String noWordSep = buffer.getStringProperty("noWordSep");
-		matcher.setNoWordSep(noWordSep);
+		if(matcher.wholeWord)
+		{
+			String noWordSep = buffer.getStringProperty("noWordSep");
+			matcher.setNoWordSep(noWordSep);
+		}
 		int occurCount = 0;
 
 		boolean endOfLine = (buffer.getLineEndOffset(
 			buffer.getLineOfOffset(end)) - 1 == end);
 
 		int offset = start;
-loop:		for(int counter = 0; ; counter++)
+loop:	for(int counter = 0; ; counter++)
 		{
 			boolean startOfLine = (buffer.getLineStartOffset(
 				buffer.getLineOfOffset(offset)) == offset);
diff --git a/org/gjt/sp/jedit/search/SearchBar.java b/org/gjt/sp/jedit/search/SearchBar.java
index 9c811fb..7e3107d 100644
--- a/org/gjt/sp/jedit/search/SearchBar.java
+++ b/org/gjt/sp/jedit/search/SearchBar.java
@@ -1,6 +1,6 @@
 /*
  * SearchBar.java - Search & replace toolbar
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2000, 2001, 2002 Slava Pestov
@@ -36,7 +36,7 @@ import org.gjt.sp.util.Log;
 
 /**
  * Incremental search tool bar.
- * @version $Id: SearchBar.java 20196 2011-11-03 16:55:44Z kpouer $
+ * @version $Id: SearchBar.java 22223 2012-09-20 07:22:28Z shlomy $
  */
 public class SearchBar extends JToolBar
 {
@@ -99,7 +99,7 @@ public class SearchBar extends JToolBar
 		hyperSearch.setRequestFocusEnabled(false);
 
 		add(wholeWord = new JCheckBox(jEdit.getProperty(
-			"search.word")));
+			"search.word.bar")));
 		wholeWord.addActionListener(actionHandler);
 		wholeWord.setMargin(margin);
 		wholeWord.setOpaque(false);
diff --git a/org/gjt/sp/jedit/search/SearchDialog.java b/org/gjt/sp/jedit/search/SearchDialog.java
index e95aba8..f253975 100644
--- a/org/gjt/sp/jedit/search/SearchDialog.java
+++ b/org/gjt/sp/jedit/search/SearchDialog.java
@@ -1,6 +1,6 @@
 /*
  * SearchDialog.java - Search and replace dialog
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2004 Slava Pestov
@@ -28,6 +28,8 @@ import javax.swing.*;
 
 import java.awt.*;
 import java.awt.event.*;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -35,14 +37,13 @@ import org.gjt.sp.jedit.EditBus.EBHandler;
 import org.gjt.sp.jedit.browser.VFSBrowser;
 import org.gjt.sp.jedit.gui.*;
 import org.gjt.sp.jedit.io.*;
-import org.gjt.sp.jedit.msg.SearchSettingsChanged;
 import org.gjt.sp.jedit.*;
 //}}}
 
 /**
  * Search and replace dialog.
  * @author Slava Pestov
- * @version $Id: SearchDialog.java 20453 2011-11-28 20:24:27Z evanpw $
+ * @version $Id: SearchDialog.java 22471 2012-11-14 15:55:39Z daleanson $
  */
 public class SearchDialog extends EnhancedDialog
 {
@@ -260,6 +261,52 @@ public class SearchDialog extends EnhancedDialog
 		}
 	} //}}}
 	
+	//{{{ initFocusOrder() method
+	private void initFocusOrder() 
+	{
+		// find and replace history fields
+		focusOrder.add(find);
+		focusOrder.add(replace);
+		
+		// buttons
+		focusOrder.add(findBtn);
+		focusOrder.add(replaceBtn);
+		focusOrder.add(replaceAndFindBtn);
+		focusOrder.add(replaceAllBtn);
+		focusOrder.add(closeBtn);
+		
+		// replace with text or beanshell snippet radio buttons
+		focusOrder.add(stringReplace);
+		focusOrder.add(beanShellReplace);
+		
+		// search in settings
+		focusOrder.add(searchSelection);
+		focusOrder.add(searchCurrentBuffer);
+		focusOrder.add(searchAllBuffers);
+		focusOrder.add(searchDirectory);
+		
+		// search settings
+		focusOrder.add(keepDialog);
+		focusOrder.add(ignoreCase);
+		focusOrder.add(regexp);
+		focusOrder.add(hyperSearch);
+		focusOrder.add(wholeWord);
+		
+		// direction settings
+		focusOrder.add(searchBack);
+		focusOrder.add(searchForward);
+		focusOrder.add(wrap);
+		
+		// directory controls
+		focusOrder.add(filter);
+		focusOrder.add(synchronize);
+		focusOrder.add(directory);
+		focusOrder.add(choose);
+		focusOrder.add(searchSubDirectories);
+		focusOrder.add(skipHidden);
+		focusOrder.add(skipBinaryFiles);
+	} //}}}
+	
 	//{{{ dispose() method
 	@Override
 	public void dispose()
@@ -302,6 +349,8 @@ public class SearchDialog extends EnhancedDialog
 		closeBtn;
 
 	private boolean saving;
+	
+	private FocusOrder focusOrder;
 	//}}}
 
 	//{{{ SearchDialog constructor
@@ -327,6 +376,11 @@ public class SearchDialog extends EnhancedDialog
 
 		content.add(BorderLayout.EAST,createButtonsPanel());
 
+		setFocusTraversalPolicyProvider(true);
+		focusOrder = new FocusOrder();
+		initFocusOrder();
+		setFocusTraversalPolicy(focusOrder);
+		
 		pack();
 		jEdit.unsetProperty("search.width");
 		jEdit.unsetProperty("search.d-width");
@@ -381,42 +435,39 @@ public class SearchDialog extends EnhancedDialog
 		fieldPanel.add(label,cons);
 		cons.gridy++;
 
+		cons.gridx = 0;
+		cons.gridwidth = 2;
+		cons.insets = new Insets(0,0,0,0);
+		replace = new HistoryTextArea("replace");
+		replace.setName("replace");
+		replace.setToolTipText(jEdit.getProperty("search.find.tooltip"));
+		label.setLabelFor(replace);
+
+		cons.gridx = 0;
+		cons.gridy++;
+		cons.weightx = 1.0;
+		cons.weighty = 1.0;
+		fieldPanel.add(new JScrollPane(replace),cons);
+		cons.gridy++;
+		
 		ButtonGroup grp = new ButtonGroup();
 		ReplaceActionHandler replaceActionHandler = new ReplaceActionHandler();
 
-		// we use a custom JRadioButton subclass that returns
-		// false for isFocusTraversable() so that the user can
-		// tab from the search field to the replace field with
-		// one keystroke
-
-		stringReplace = new MyJRadioButton(jEdit.getProperty(
+		stringReplace = new JRadioButton(jEdit.getProperty(
 			"search.string-replace-btn"));
 		stringReplace.addActionListener(replaceActionHandler);
 		grp.add(stringReplace);
 		cons.gridwidth = 1;
 		fieldPanel.add(stringReplace,cons);
+		
 		cons.gridx++;
 		cons.insets = new Insets(0,12,0,0);
-
-		beanShellReplace = new MyJRadioButton(jEdit.getProperty(
+		beanShellReplace = new JRadioButton(jEdit.getProperty(
 			"search.beanshell-replace-btn"));
 		beanShellReplace.addActionListener(replaceActionHandler);
 		grp.add(beanShellReplace);
 		fieldPanel.add(beanShellReplace,cons);
-		cons.gridx = 0;
-		cons.gridwidth = 2;
-		cons.insets = new Insets(0,0,0,0);
-
-		replace = new HistoryTextArea("replace");
-		replace.setName("replace");
-		replace.setToolTipText(jEdit.getProperty("search.find.tooltip"));
-		label.setLabelFor(replace);
-
-		cons.gridx = 0;
-		cons.gridy++;
-		cons.weightx = 1.0;
-		cons.weighty = 1.0;
-		fieldPanel.add(new JScrollPane(replace),cons);
+		
 		cons.gridy++;
 	} //}}}
 
@@ -533,7 +584,7 @@ public class SearchDialog extends EnhancedDialog
 			.charAt(0));
 		searchSettings.add(wholeWord);
 		wholeWord.addActionListener(actionHandler);
-
+		
 		return searchSettings;
 	} //}}}
 
@@ -588,13 +639,13 @@ public class SearchDialog extends EnhancedDialog
 		synchronize.addActionListener(actionListener);
 		layout.setConstraints(synchronize,cons);
 		multifile.add(synchronize);
-
+		
 		cons.gridy++;
 
 		directory = new HistoryTextField("search.directory");
 		directory.setColumns(25);
 		directory.addActionListener(actionListener);
-
+		
 		label = new JLabel(jEdit.getProperty("search.directoryField"),
 			SwingConstants.RIGHT);
 		label.setBorder(new EmptyBorder(0,0,0,12));
@@ -622,7 +673,7 @@ public class SearchDialog extends EnhancedDialog
 		layout.setConstraints(choose,cons);
 		multifile.add(choose);
 		choose.addActionListener(actionListener);
-
+		
 		cons.insets = new Insets(0,0,0,0);
 		cons.gridy++;
 		cons.gridwidth = 3;
@@ -664,15 +715,15 @@ public class SearchDialog extends EnhancedDialog
 		JPanel grid = new JPanel(new GridLayout(5,1,0,12));
 
 		findBtn = new JButton(jEdit.getProperty("search.findBtn"));
-		/* findBtn.setMnemonic(jEdit.getProperty("search.findBtn.mnemonic")
-			.charAt(0)); */
+		findBtn.setMnemonic(jEdit.getProperty("search.findBtn.mnemonic")
+			.charAt(0));
 		getRootPane().setDefaultButton(findBtn);
 		grid.add(findBtn);
 		findBtn.addActionListener(actionHandler);
 
 		replaceBtn = new JButton(jEdit.getProperty("search.replaceBtn", "Replace"));
-		/* replaceBtn.setMnemonic(jEdit.getProperty("search.replaceBtn.mnemonic")
-			.charAt(0)); */
+		replaceBtn.setMnemonic(jEdit.getProperty("search.replaceBtn.mnemonic")
+			.charAt(0));
 		grid.add(replaceBtn);
 		replaceBtn.addActionListener(actionHandler);
 
@@ -773,7 +824,7 @@ public class SearchDialog extends EnhancedDialog
 					hyperSearch.isSelected());
 			}
 			else if(searchAllBuffers.isSelected())
-				fileset = new AllBufferSet(filter);
+				fileset = new AllBufferSet(filter, view);
 			else if(searchDirectory.isSelected())
 			{
 				String directory = this.directory.getText();
@@ -798,10 +849,12 @@ public class SearchDialog extends EnhancedDialog
 				if(fileset instanceof DirectoryListSet)
 				{
 					DirectoryListSet dset = (DirectoryListSet)fileset;
+					// dset may be a subclass of DirectoryListSet so
+					// we can't create a new DirectoryListSet object here
+					// as it's done with other filesets (#3549670)
 					dset.setDirectory(directory);
 					dset.setFileFilter(filter);
 					dset.setRecursive(recurse);
-					EditBus.send(new SearchSettingsChanged(null));
 				}
 				else
 					fileset = new DirectoryListSet(directory,filter,recurse);
@@ -810,6 +863,9 @@ public class SearchDialog extends EnhancedDialog
 			{
 				// can't happen
 				fileset = null;
+				throw new IllegalStateException("One of search Selection, " +
+					"current Buffer, directory, " +
+					"all buffers must be selected!");
 			}
 
 			jEdit.setBooleanProperty("search.subdirs.toggle",
@@ -933,25 +989,6 @@ public class SearchDialog extends EnhancedDialog
 
 	//{{{ Inner classes
 
-	//{{{ MyJRadioButton class
-
-	// used for the stringReplace and beanShell replace radio buttons,
-	// so that the user can press tab to go from the find field to the
-	// replace field in one go
-	static class MyJRadioButton extends JRadioButton
-	{
-		MyJRadioButton(String label)
-		{
-			super(label);
-		}
-
-		@Override
-		public boolean isFocusable()
-		{
-			return false;
-		}
-	} //}}}
-
 	//{{{ ReplaceActionHandler class
 	class ReplaceActionHandler implements ActionListener
 	{
@@ -1015,20 +1052,17 @@ public class SearchDialog extends EnhancedDialog
 		//{{{ synchronizeMultiFileSettings() method
 		private void synchronizeMultiFileSettings()
 		{
-			directory.setText(view.getBuffer().getDirectory());
-
-			SearchFileSet fileset = SearchAndReplace.getSearchFileSet();
-
-			if(fileset instanceof AllBufferSet)
+			// don't sync search directory when "search all buffers" is active
+			if(searchDirectory.isSelected())
 			{
-				filter.setText(((AllBufferSet)fileset)
-					.getFileFilter());
+				directory.setText(view.getBuffer().getDirectory());
 			}
-			else
+			
+			if (!jEdit.getBooleanProperty("search.dontSyncFilter", false))
 			{
 				filter.setText('*' + MiscUtilities
 					.getFileExtension(view.getBuffer()
-					.getName()));
+						.getName()));
 			}
 		} //}}}
 	} //}}}
@@ -1099,5 +1133,76 @@ public class SearchDialog extends EnhancedDialog
 		}
 	} //}}}
 
+	//{{{ FocusOrder class
+	// Simple focus order policy, focus order is the order components are added
+	// to this policy.
+	class FocusOrder extends FocusTraversalPolicy
+	{
+		private List<Component> components = new ArrayList<Component>();
+		
+		public void add(Component component) 
+		{
+			components.add(component);	
+		}
+		
+		public Component getComponentAfter(Container aContainer, Component aComponent)
+		{
+			int index = components.indexOf(aComponent);
+			if (index == -1) 
+			{
+				return null;
+			}
+			index = index >= components.size() - 1 ? 0 : index + 1;
+			Component component = components.get(index);
+			if (!(component.isEnabled() && component.isFocusable())) 
+			{
+				return getComponentAfter(aContainer, component);
+			}
+			else
+			{
+				return components.get(index);
+			}
+		}
+		
+		public Component getComponentBefore(Container aContainer, Component aComponent)
+		{
+			int index = components.indexOf(aComponent);
+			if (index == -1) 
+			{
+				return null;
+			}
+			index = index == 0 ? components.size() - 1 : index - 1;
+			Component component = components.get(index);
+			if (!(component.isEnabled() && component.isFocusable())) 
+			{
+				return getComponentBefore(aContainer, component);
+			}
+			else
+			{
+				return components.get(index);
+			}
+		}
+		
+		public Component getDefaultComponent(Container aContainer)
+		{
+			return components.size() > 0 ? components.get(0) : null;
+		}
+		
+		public Component getFirstComponent(Container aContainer)
+		{
+			return components.size() > 0 ? components.get(0) : null;
+		}
+		
+		public Component getInitialComponent(Window window)
+		{
+			return components.size() > 0 ? components.get(0) : null;
+		}
+		
+		public Component getLastComponent(Container aContainer) 		
+		{
+			return components.size() > 0 ? components.get(components.size() - 1) : null;
+		}
+	} //}}}
+	
 	//}}}
 }
diff --git a/org/gjt/sp/jedit/search/SearchMatcher.java b/org/gjt/sp/jedit/search/SearchMatcher.java
index c3c44eb..95c8442 100644
--- a/org/gjt/sp/jedit/search/SearchMatcher.java
+++ b/org/gjt/sp/jedit/search/SearchMatcher.java
@@ -1,6 +1,6 @@
 /*
  * SearchMatcher.java - Abstract string matcher interface
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2001, 2002 Slava Pestov
@@ -27,7 +27,7 @@ import org.gjt.sp.jedit.TextUtilities;
 /**
  * An abstract class for matching strings.
  * @author Slava Pestov
- * @version $Id: SearchMatcher.java 19386 2011-02-24 11:06:57Z kpouer $
+ * @version $Id: SearchMatcher.java 22941 2013-04-22 11:06:59Z thomasmey $
  */
 public abstract class SearchMatcher
 {
@@ -50,7 +50,7 @@ public abstract class SearchMatcher
 	 * @since jEdit 4.3pre5
 	 */
 	public abstract Match nextMatch(CharSequence text, boolean start,
-		boolean end, boolean firstTime, boolean reverse);
+		boolean end, boolean firstTime, boolean reverse) throws InterruptedException;
 
 	/**
 	 * @param noWordSep the chars that are considered as word chars for this search
diff --git a/org/gjt/sp/jedit/services.xml b/org/gjt/sp/jedit/services.xml
index c1ee046..22755e0 100644
--- a/org/gjt/sp/jedit/services.xml
+++ b/org/gjt/sp/jedit/services.xml
@@ -50,6 +50,9 @@
 	<SERVICE CLASS="org.gjt.sp.jedit.io.Encoding" NAME="X-UTF-32BE-BOM">
 		new EncodingWithBOM("UTF-32BE");
 	</SERVICE>
+	<SERVICE CLASS="org.gjt.sp.jedit.io.Encoding" NAME="Native2ASCII">
+		new Native2ASCIIEncoding();
+	</SERVICE>
 
 	<!-- Encoding detectors -->
 	<SERVICE CLASS="org.gjt.sp.jedit.io.EncodingDetector" NAME="BOM">
@@ -174,4 +177,9 @@
 	<SERVICE CLASS="org.jedit.core.MigrationService" NAME="keymap">
 		new org.jedit.migration.KeymapMigration();
 	</SERVICE>
+	
+	<SERVICE CLASS="org.jedit.migration.OneTimeMigrationService" NAME="checkFileStatus" >
+	  new org.jedit.migration.CheckFileStatus();
+	</SERVICE>
+	
 </SERVICES>
diff --git a/org/gjt/sp/jedit/syntax/Chunk.java b/org/gjt/sp/jedit/syntax/Chunk.java
index 31476a5..6935a1e 100644
--- a/org/gjt/sp/jedit/syntax/Chunk.java
+++ b/org/gjt/sp/jedit/syntax/Chunk.java
@@ -1,7 +1,7 @@
 /*
  * Chunk.java - A syntax token with extra information required for painting it
  * on screen
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2002 Slava Pestov
diff --git a/org/gjt/sp/jedit/syntax/DefaultTokenHandler.java b/org/gjt/sp/jedit/syntax/DefaultTokenHandler.java
index 38aa048..c42c81e 100644
--- a/org/gjt/sp/jedit/syntax/DefaultTokenHandler.java
+++ b/org/gjt/sp/jedit/syntax/DefaultTokenHandler.java
@@ -1,6 +1,6 @@
 /*
  * DefaultTokenHandler.java - Builds a linked list of Token objects
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Slava Pestov
@@ -28,7 +28,7 @@ import javax.swing.text.Segment;
  * Builds a linked list of tokens without any additional processing.
  *
  * @author Slava Pestov
- * @version $Id: DefaultTokenHandler.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: DefaultTokenHandler.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.1pre1
  */
 public class DefaultTokenHandler implements TokenHandler
diff --git a/org/gjt/sp/jedit/syntax/DisplayTokenHandler.java b/org/gjt/sp/jedit/syntax/DisplayTokenHandler.java
index cff998e..8d40a6a 100644
--- a/org/gjt/sp/jedit/syntax/DisplayTokenHandler.java
+++ b/org/gjt/sp/jedit/syntax/DisplayTokenHandler.java
@@ -1,6 +1,6 @@
 /*
  * DisplayTokenHandler.java - converts tokens to chunks
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:encoding=utf-8:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -32,7 +32,7 @@ import java.text.CharacterIterator;
 
 /**
  * Creates {@link Chunk} objects that can be painted on screen.
- * @version $Id: DisplayTokenHandler.java 21688 2012-05-19 19:44:16Z k_satoda $
+ * @version $Id: DisplayTokenHandler.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class DisplayTokenHandler extends DefaultTokenHandler
 {
diff --git a/org/gjt/sp/jedit/syntax/DummyTokenHandler.java b/org/gjt/sp/jedit/syntax/DummyTokenHandler.java
index ecbd88d..a3673fd 100644
--- a/org/gjt/sp/jedit/syntax/DummyTokenHandler.java
+++ b/org/gjt/sp/jedit/syntax/DummyTokenHandler.java
@@ -1,6 +1,6 @@
 /*
  * DummyTokenHandler.java - Ignores tokens
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Slava Pestov
@@ -28,7 +28,7 @@ import javax.swing.text.Segment;
  * A dummy token handler that discards tokens.
  *
  * @author Slava Pestov
- * @version $Id: DummyTokenHandler.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: DummyTokenHandler.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.1pre1
  */
 public class DummyTokenHandler implements TokenHandler
diff --git a/org/gjt/sp/jedit/syntax/KeywordMap.java b/org/gjt/sp/jedit/syntax/KeywordMap.java
index 35a7eb3..919018a 100644
--- a/org/gjt/sp/jedit/syntax/KeywordMap.java
+++ b/org/gjt/sp/jedit/syntax/KeywordMap.java
@@ -1,6 +1,6 @@
 /*
  * KeywordMap.java - Fast keyword->id map
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2002 Slava Pestov
@@ -32,7 +32,7 @@ import java.util.ArrayList;
  * text substrings without the overhead of creating a new string object.
  *
  * @author Slava Pestov, Mike Dillon
- * @version $Id: KeywordMap.java 14461 2009-01-25 12:04:15Z kpouer $
+ * @version $Id: KeywordMap.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class KeywordMap
 {
diff --git a/org/gjt/sp/jedit/syntax/ModeProvider.java b/org/gjt/sp/jedit/syntax/ModeProvider.java
index 81b1cea..15d20f9 100644
--- a/org/gjt/sp/jedit/syntax/ModeProvider.java
+++ b/org/gjt/sp/jedit/syntax/ModeProvider.java
@@ -1,6 +1,6 @@
 /*
  * ModeProvider.java - An edit mode provider.
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -22,6 +22,8 @@
 package org.gjt.sp.jedit.syntax;
 
 //{{{ Imports
+import java.io.Closeable;
+
 import org.gjt.sp.jedit.Mode;
 import org.gjt.sp.util.IOUtilities;
 import org.gjt.sp.util.Log;
@@ -99,7 +101,7 @@ public class ModeProvider
 		if (filename != null && filename.endsWith(".gz"))
 			filename = filename.substring(0, filename.length() - 3);
 
-		List<Mode> acceptable = new ArrayList<Mode>();
+		List<Mode> acceptable = new ArrayList<Mode>(1);
 		for(Mode mode : modes.values())
 		{
 			if(mode.accept(filepath, filename, firstLine))
@@ -233,7 +235,7 @@ public class ModeProvider
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(grammar);
+			IOUtilities.closeQuietly((Closeable)grammar);
 		}
 	} //}}}
 
diff --git a/org/gjt/sp/jedit/syntax/ParserRule.java b/org/gjt/sp/jedit/syntax/ParserRule.java
index aacd9ed..31dfd67 100644
--- a/org/gjt/sp/jedit/syntax/ParserRule.java
+++ b/org/gjt/sp/jedit/syntax/ParserRule.java
@@ -1,6 +1,6 @@
 /*
  * ParserRule.java - Parser rule for the token marker
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999 mike dillon
@@ -32,7 +32,7 @@ import java.util.regex.PatternSyntaxException;
 /**
  * A parser rule.
  * @author mike dillon, Slava Pestov
- * @version $Id: ParserRule.java 19474 2011-03-22 11:35:42Z kpouer $
+ * @version $Id: ParserRule.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class ParserRule
 {
diff --git a/org/gjt/sp/jedit/syntax/ParserRuleSet.java b/org/gjt/sp/jedit/syntax/ParserRuleSet.java
index 434a0c0..489203a 100644
--- a/org/gjt/sp/jedit/syntax/ParserRuleSet.java
+++ b/org/gjt/sp/jedit/syntax/ParserRuleSet.java
@@ -1,6 +1,6 @@
 /*
  * ParserRuleSet.java - A set of parser rules
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999 mike dillon
@@ -31,7 +31,7 @@ import java.util.regex.Pattern;
 /**
  * A set of parser rules.
  * @author mike dillon
- * @version $Id: ParserRuleSet.java 19477 2011-03-22 12:25:14Z kpouer $
+ * @version $Id: ParserRuleSet.java 22883 2013-03-23 17:58:56Z thomasmey $
  */
 public class ParserRuleSet
 {
@@ -165,7 +165,6 @@ public class ParserRuleSet
 				rules = new ArrayList<ParserRule>();
 				ruleMap.put(key,rules);
 			}
-			int ruleAmount = rules.size();
 			rules.add(r);
 		}
 	} //}}}
diff --git a/org/gjt/sp/jedit/syntax/SyntaxStyle.java b/org/gjt/sp/jedit/syntax/SyntaxStyle.java
index 1a86809..856e765 100644
--- a/org/gjt/sp/jedit/syntax/SyntaxStyle.java
+++ b/org/gjt/sp/jedit/syntax/SyntaxStyle.java
@@ -1,6 +1,6 @@
 /*
  * SyntaxStyle.java - A simple text style class
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2003 Slava Pestov
@@ -28,7 +28,7 @@ import java.awt.Color;
  * A simple text style class. It can specify the color, italic flag,
  * and bold flag of a run of text.
  * @author Slava Pestov
- * @version $Id: SyntaxStyle.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: SyntaxStyle.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class SyntaxStyle
 {
diff --git a/org/gjt/sp/jedit/syntax/SyntaxUtilities.java b/org/gjt/sp/jedit/syntax/SyntaxUtilities.java
index 5508156..415b122 100644
--- a/org/gjt/sp/jedit/syntax/SyntaxUtilities.java
+++ b/org/gjt/sp/jedit/syntax/SyntaxUtilities.java
@@ -1,6 +1,6 @@
 /*
  * SyntaxUtilities.java - Utility functions
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -26,7 +26,7 @@ import javax.swing.text.Segment;
 /**
  * Contains utility functions used by the syntax highlighting code.
  * @since jEdit 4.2pre1
- * @version $Id: SyntaxUtilities.java 19475 2011-03-22 12:04:35Z kpouer $
+ * @version $Id: SyntaxUtilities.java 21831 2012-06-18 22:54:17Z ezust $
  * @author Slava Pestov
  */
 public class SyntaxUtilities
diff --git a/org/gjt/sp/jedit/syntax/Token.java b/org/gjt/sp/jedit/syntax/Token.java
index 2f43a37..3d13f71 100644
--- a/org/gjt/sp/jedit/syntax/Token.java
+++ b/org/gjt/sp/jedit/syntax/Token.java
@@ -1,6 +1,6 @@
 /*
  * Token.java - Syntax token
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 1999, 2000, 2001, 2002 Slava Pestov
@@ -27,7 +27,7 @@ import java.lang.reflect.Field;
  * A linked list of syntax tokens.
  *
  * @author Slava Pestov
- * @version $Id: Token.java 15712 2009-07-19 19:40:40Z shlomy $
+ * @version $Id: Token.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class Token
 {
diff --git a/org/gjt/sp/jedit/syntax/TokenHandler.java b/org/gjt/sp/jedit/syntax/TokenHandler.java
index 3ddc1dd..3de9aee 100644
--- a/org/gjt/sp/jedit/syntax/TokenHandler.java
+++ b/org/gjt/sp/jedit/syntax/TokenHandler.java
@@ -1,7 +1,7 @@
 /*
  * TokenHandler.java - Token markers send tokens to implementations of
  * this class
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Slava Pestov
@@ -29,7 +29,7 @@ import javax.swing.text.Segment;
  * Token markers send tokens to implementations of this interface.
  *
  * @author Slava Pestov
- * @version $Id: TokenHandler.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: TokenHandler.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.1pre1
  */
 public interface TokenHandler
diff --git a/org/gjt/sp/jedit/syntax/TokenMarker.java b/org/gjt/sp/jedit/syntax/TokenMarker.java
index a88eea1..3a788b2 100644
--- a/org/gjt/sp/jedit/syntax/TokenMarker.java
+++ b/org/gjt/sp/jedit/syntax/TokenMarker.java
@@ -1,6 +1,6 @@
 /*
  * TokenMarker.java - Tokenizes lines of text
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1998, 2003 Slava Pestov
@@ -40,7 +40,7 @@ import org.gjt.sp.util.StandardUtilities;
  * or font style for painting that token.
  *
  * @author Slava Pestov, mike dillon
- * @version $Id: TokenMarker.java 21285 2012-03-09 15:46:47Z k_satoda $
+ * @version $Id: TokenMarker.java 21831 2012-06-18 22:54:17Z ezust $
  *
  * @see org.gjt.sp.jedit.syntax.Token
  * @see org.gjt.sp.jedit.syntax.TokenHandler
diff --git a/org/gjt/sp/jedit/syntax/XModeHandler.java b/org/gjt/sp/jedit/syntax/XModeHandler.java
index 804d4a5..d3b687b 100644
--- a/org/gjt/sp/jedit/syntax/XModeHandler.java
+++ b/org/gjt/sp/jedit/syntax/XModeHandler.java
@@ -1,6 +1,6 @@
 /*
  * XModeHandler.java - XML handler for mode files
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999 mike dillon
@@ -39,7 +39,7 @@ import org.gjt.sp.util.XMLUtilities;
 
 /**
  * XML handler for mode definition files.
- * @version $Id: XModeHandler.java 21612 2012-04-28 16:49:03Z k_satoda $
+ * @version $Id: XModeHandler.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public abstract class XModeHandler extends DefaultHandler
 {
diff --git a/org/gjt/sp/jedit/syntax/xmode.dtd b/org/gjt/sp/jedit/syntax/xmode.dtd
index ae80cdf..d005070 100644
--- a/org/gjt/sp/jedit/syntax/xmode.dtd
+++ b/org/gjt/sp/jedit/syntax/xmode.dtd
@@ -98,7 +98,6 @@
 
 <!-- SPAN and SPAN_REGEXP children -->
 <!ELEMENT BEGIN ( #PCDATA ) >
-<!ATTLIST BEGIN %att-position-mix; >
 <!ELEMENT END ( #PCDATA ) >
 <!ATTLIST END
 	%att-position-mix;
diff --git a/org/gjt/sp/jedit/textarea/Anchor.java b/org/gjt/sp/jedit/textarea/Anchor.java
index 8c7f7db..4680c31 100644
--- a/org/gjt/sp/jedit/textarea/Anchor.java
+++ b/org/gjt/sp/jedit/textarea/Anchor.java
@@ -1,6 +1,6 @@
 /*
  * Anchor.java - A base point for physical line <-> screen line conversion
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
@@ -25,7 +25,7 @@ package org.gjt.sp.jedit.textarea;
 /**
  * A base point for physical line/screen line conversion.
  * @author Slava Pestov
- * @version $Id: Anchor.java 22366 2012-10-13 22:21:34Z ezust $
+ * @version $Id: Anchor.java 22361 2012-10-13 12:07:28Z thomasmey $
  */
 abstract class Anchor
 {
diff --git a/org/gjt/sp/jedit/textarea/AntiAlias.java b/org/gjt/sp/jedit/textarea/AntiAlias.java
index db1f83d..95e03fb 100644
--- a/org/gjt/sp/jedit/textarea/AntiAlias.java
+++ b/org/gjt/sp/jedit/textarea/AntiAlias.java
@@ -1,6 +1,6 @@
 /*
  * AntiAlias.java - a small helper class for AntiAlias settings.
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006, 2010 Alan Ezust
@@ -64,7 +64,8 @@ public class AntiAlias
 	}
 
 	/** @return corresponding text antialias value from RenderingHints class */
-	public Object renderHint() {
+	public Object renderHint()
+	{
 		return renderHints[m_val];
 	}
 	
diff --git a/org/gjt/sp/jedit/textarea/BufferHandler.java b/org/gjt/sp/jedit/textarea/BufferHandler.java
index 0a6c0ff..69a635e 100644
--- a/org/gjt/sp/jedit/textarea/BufferHandler.java
+++ b/org/gjt/sp/jedit/textarea/BufferHandler.java
@@ -1,6 +1,6 @@
 /*
  * BufferHandler.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2005 Slava Pestov
diff --git a/org/gjt/sp/jedit/textarea/ChunkCache.java b/org/gjt/sp/jedit/textarea/ChunkCache.java
index 0ba28d2..343e53d 100644
--- a/org/gjt/sp/jedit/textarea/ChunkCache.java
+++ b/org/gjt/sp/jedit/textarea/ChunkCache.java
@@ -1,7 +1,7 @@
 /*
  * ChunkCache.java - Intermediate layer between token lists from a TokenMarker
  * and what you see on screen
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2005 Slava Pestov
@@ -42,7 +42,7 @@ import org.gjt.sp.util.Log;
  * The array is resized when the TextArea geometry changes  
  *
  * @author Slava Pestov
- * @version $Id: ChunkCache.java 22366 2012-10-13 22:21:34Z ezust $
+ * @version $Id: ChunkCache.java 22670 2013-01-12 12:29:48Z thomasmey $
  */
 class ChunkCache
 {
@@ -50,7 +50,8 @@ class ChunkCache
 	ChunkCache(TextArea textArea)
 	{
 		this.textArea = textArea;
-		out = new ArrayList<Chunk>();
+		outFull = new ArrayList<Chunk>();
+		outFullPhysicalLine = -1;
 		tokenHandler = new DisplayTokenHandler();
 	} //}}}
 
@@ -91,13 +92,12 @@ class ChunkCache
 			return -1;
 		if(line > textArea.getLastPhysicalLine())
 			return -1;
-		
+
 		if(line == lastScreenLineP)
 		{
 			LineInfo last = getLineInfo(lastScreenLine);
 
-			if(offset >= last.offset
-				&& offset < last.offset + last.length)
+			if(offset >= last.offset && offset < last.offset + last.length)
 			{
 				return lastScreenLine;
 			}
@@ -106,7 +106,7 @@ class ChunkCache
 		int screenLine = -1;
 
 		// Find the screen line containing this offset
-		for(int i = 0; i < textArea.getVisibleLines(); i++)
+		for(int i = 0, n = textArea.getVisibleLines(); i < n; i++)
 		{
 			LineInfo info = getLineInfo(i);
 			if(info.physicalLine > line)
@@ -117,8 +117,7 @@ class ChunkCache
 			}
 			if(info.physicalLine == line)
 			{
-				if(offset >= info.offset
-					&& offset < info.offset + info.length)
+				if(offset >= info.offset && offset < info.offset + info.length)
 				{
 					screenLine = i;
 					break;
@@ -129,7 +128,6 @@ class ChunkCache
 		if(screenLine == -1)
 			return -1;
 
-
 		lastScreenLineP = line;
 		lastScreenLine = screenLine;
 
@@ -229,9 +227,19 @@ class ChunkCache
 		lastScreenLine = lastScreenLineP = -1;
 	} //}}}
 
+	public void reset()
+	{
+		invalidateAll();
+		outFullPhysicalLine = -1;
+		outFull.clear();
+	}
+
 	//{{{ invalidateChunksFromPhys() method
 	void invalidateChunksFromPhys(int physicalLine)
 	{
+		if(physicalLine == outFullPhysicalLine)
+			outFullPhysicalLine = -1;
+
 		for(int i = 0; i < firstInvalidLine; i++)
 		{
 			LineInfo info = lineInfo[i];
@@ -268,10 +276,9 @@ class ChunkCache
 		if(!textArea.softWrap)
 			return 1;
 
-		out.clear();
-		lineToChunkList(physicalLine,out);
+		lineToChunkList(physicalLine);
 
-		int size = out.size();
+		int size = outFull.size();
 		if(size == 0)
 			return 1;
 		else
@@ -492,17 +499,21 @@ class ChunkCache
 	//{{{ getLineInfosForPhysicalLine() method
 	LineInfo[] getLineInfosForPhysicalLine(int physicalLine)
 	{
-		out.clear();
-
 		if(!buffer.isLoading())
-			lineToChunkList(physicalLine,out);
+			lineToChunkList(physicalLine);
+
+		assert physicalLine == outFullPhysicalLine;
 
-		if(out.isEmpty())
-			out.add(null);
+		List<Chunk> chunkList = null;
+		if(outFull.isEmpty()) {
+			chunkList = new ArrayList<Chunk>();
+			chunkList.add(null);
+		} else
+			chunkList = outFull;
 
-		List<LineInfo> returnValue = new ArrayList<LineInfo>(out.size());
-		getLineInfosForPhysicalLine(physicalLine,returnValue);
-		return returnValue.toArray(new LineInfo[out.size()]);
+		List<LineInfo> returnValue = new ArrayList<LineInfo>(chunkList.size());
+		getLineInfosForPhysicalLine(physicalLine,returnValue, chunkList);
+		return returnValue.toArray(new LineInfo[chunkList.size()]);
 	} //}}}
 
 	//{{{ Private members
@@ -516,7 +527,20 @@ class ChunkCache
 	 * The content is valid from 0 to {@link #firstInvalidLine}
 	 */
 	private LineInfo[] lineInfo;
-	private final List<Chunk> out;
+
+	/**
+	 * All Chunks for the current physical line, see also {@link #outFullPhysicalLine}
+	 * The Chunks were created via a call to {@link #lineToChunkList(int)}.
+	 */
+	private final List<Chunk> outFull;
+
+	/**
+	 * Physical line number of the current tokenized/chunked line
+	 * This field contains -1 if the line was not tokenized yet, or
+	 * if the outFull cache was dropped via a {@link #reset()} call
+	 * See also {@link #outFull}
+	 */
+	private int outFullPhysicalLine;
 
 	/** The first invalid line. All lines before this one are valid. */
 	private int firstInvalidLine;
@@ -529,11 +553,13 @@ class ChunkCache
 	//}}}
 
 	//{{{ getLineInfosForPhysicalLine() method
-	private void getLineInfosForPhysicalLine(int physicalLine, List<LineInfo> list)
+	private void getLineInfosForPhysicalLine(int physicalLine, List<LineInfo> list, List<Chunk> chunkList)
 	{
-		for(int i = 0; i < out.size(); i++)
+		assert outFullPhysicalLine == physicalLine;
+
+		for(int i = 0; i < chunkList.size(); i++)
 		{
-			Chunk chunks = out.get(i);
+			Chunk chunks = chunkList.get(i);
 			LineInfo info = new LineInfo();
 			info.physicalLine = physicalLine;
 			if(i == 0)
@@ -544,7 +570,7 @@ class ChunkCache
 			else
 				info.offset = chunks.offset;
 
-			if(i == out.size() - 1)
+			if(i == chunkList.size() - 1)
 			{
 				info.lastSubregion = true;
 				info.length = textArea.getLineLength(physicalLine)
@@ -552,7 +578,7 @@ class ChunkCache
 			}
 			else
 			{
-				info.length = out.get(i + 1).offset
+				info.length = outFull.get(i + 1).offset
 					- info.offset;
 			}
 
@@ -616,6 +642,8 @@ class ChunkCache
 
 		// if one line's chunks are invalid, remaining lines are also
 		// invalid
+		// i.e. if the lastScreenLine is smaller as the first invalid
+		// screen line we don't need to update the chunks, leave here
 		if(lastScreenLine < firstInvalidLine)
 			return;
 
@@ -628,12 +656,12 @@ class ChunkCache
 				+ " to " + lastScreenLine);
 		}
 
+		// Below comment is not true any more (at least partly):
 		// Note that we rely on the fact that when a physical line is
 		// invalidated, all screen lines/subregions of that line are
 		// invalidated as well. See below comment for code that tries
 		// to uphold this assumption.
-
-		out.clear();
+		List<Chunk> out = new ArrayList<Chunk>(0);
 
 		int offset;
 		int length;
@@ -668,7 +696,8 @@ class ChunkCache
 				}
 
 				// chunk the line.
-				lineToChunkList(physicalLine,out);
+				lineToChunkList(physicalLine);
+				out = outFull.subList(0, outFull.size());
 
 				info.firstSubregion = true;
 
@@ -692,7 +721,7 @@ class ChunkCache
 				// otherwise, the number of subregions
 				else
 				{
-					if(i == 0)
+					if(i == 0) //FIXME: (i == 0)!? - not (i == firstLine)?
 					{
 						int skew = textArea.displayManager.firstLine.getSkew();
 						if(skew >= out.size())
@@ -706,11 +735,11 @@ class ChunkCache
 						else if(skew > 0)
 						{
 							info.firstSubregion = false;
-							for(int j = 0; j < skew; j++)
-								out.remove(0);
+							out = outFull.subList(skew, outFull.size());
 						}
 					}
-					chunks = out.remove(0);
+					chunks = out.get(0);
+					out = out.subList(1, out.size());
 					offset = chunks.offset;
 					if (!out.isEmpty())
 						length = out.get(0).offset - offset;
@@ -722,7 +751,8 @@ class ChunkCache
 			{
 				info.firstSubregion = false;
 
-				chunks = out.remove(0);
+				chunks = out.get(0);
+				out = out.subList(1, out.size());
 				offset = chunks.offset;
 				if (!out.isEmpty())
 					length = out.get(0).offset - offset;
@@ -732,8 +762,7 @@ class ChunkCache
 
 			boolean lastSubregion = out.isEmpty();
 
-			if(i == lastScreenLine
-				&& lastScreenLine != lineInfo.length - 1)
+			if(i == lastScreenLine && lastScreenLine != lineInfo.length - 1)
 			{
 				/* if the user changes the syntax token at the
 				 * end of a line, need to do a full repaint. */
@@ -777,16 +806,24 @@ class ChunkCache
 	} //}}}
 
 	//{{{ lineToChunkList() method
-	private void lineToChunkList(int physicalLine, List<Chunk> out)
+	/** chunks the line and fill outFull array with the chunks for the given physical line */
+	private void lineToChunkList(int physicalLine)
 	{
-		TextAreaPainter painter = textArea.getPainter();
-		TabExpander expander= textArea.getTabExpander();
-		tokenHandler.init(painter.getStyles(),
-			painter.getFontRenderContext(),
-			expander,out,
-			textArea.softWrap
-			? textArea.wrapMargin : 0.0f, buffer.getLineStartOffset(physicalLine));
-		buffer.markTokens(physicalLine,tokenHandler);
+		assert physicalLine >= 0;
+
+		if(outFullPhysicalLine != physicalLine) {
+			TextAreaPainter painter = textArea.getPainter();
+			TabExpander expander= textArea.getTabExpander();
+			tokenHandler.init(painter.getStyles(),
+					painter.getFontRenderContext(),
+					expander,outFull,
+					textArea.softWrap
+					? textArea.wrapMargin : 0.0f, buffer.getLineStartOffset(physicalLine));
+
+			outFull.clear();
+			buffer.markTokens(physicalLine,tokenHandler);
+			outFullPhysicalLine = physicalLine;
+		}
 	} //}}}
 
 	//}}}
diff --git a/org/gjt/sp/jedit/textarea/CircleFoldPainter.java b/org/gjt/sp/jedit/textarea/CircleFoldPainter.java
index e55618d..1ccedc4 100644
--- a/org/gjt/sp/jedit/textarea/CircleFoldPainter.java
+++ b/org/gjt/sp/jedit/textarea/CircleFoldPainter.java
@@ -1,35 +1,35 @@
-/*
- * CircleFoldPainter.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2008 Shlomy Reinstein
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.textarea;
-
-import java.awt.Graphics2D;
-
-public class CircleFoldPainter extends ShapedFoldPainter
-{
-	@Override
-	protected void paintFoldShape(Graphics2D gfx, int top, int bottom)
-	{
-		gfx.drawArc(1,top,8,(bottom - top),0,360);
-	}
-
-}
+/*
+ * CircleFoldPainter.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2008 Shlomy Reinstein
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.textarea;
+
+import java.awt.Graphics2D;
+
+public class CircleFoldPainter extends ShapedFoldPainter
+{
+	@Override
+	protected void paintFoldShape(Graphics2D gfx, int top, int bottom)
+	{
+		gfx.drawArc(1,top,8,(bottom - top),0,360);
+	}
+
+}
diff --git a/org/gjt/sp/jedit/textarea/ColumnBlock.java b/org/gjt/sp/jedit/textarea/ColumnBlock.java
index 10e85bf..5d56f04 100644
--- a/org/gjt/sp/jedit/textarea/ColumnBlock.java
+++ b/org/gjt/sp/jedit/textarea/ColumnBlock.java
@@ -1,420 +1,420 @@
-/*
- * ColumnBlock.java 
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 Anshal Shukla
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.textarea;
-
-import java.util.Vector;
-
-import org.gjt.sp.jedit.buffer.JEditBuffer;
-import org.gjt.sp.jedit.textarea.Selection.Rect;
-
-public class ColumnBlock extends Rect implements Node
-{
-	private Node parent;
-
-	private Vector<Node> children = new Vector<Node>();
-
-	private Vector<ColumnBlockLine> lines = new Vector<ColumnBlockLine>();
-
-	float columnBlockWidth;
-
-	private boolean tabSizesDirty = true;
-
-	private JEditBuffer buffer;
-
-	private boolean isDirty;
-
-	@Override
-	//{{{ addChild() method
-	public void addChild(Node node)
-	{
-		// must add the children in sorted order
-		ColumnBlock block = (ColumnBlock) node;
-		ColumnBlock blockBelow = searchChildren(block.startLine);
-		if (blockBelow != null)
-		{
-			if (blockBelow.isLineWithinThisBlock(block.endLine) >= 0)
-			{
-				throw new IllegalArgumentException("Overlapping column blocks: "
-					+ block + " \n&\n" + blockBelow);
-			}
-			int index = children.indexOf(blockBelow);
-			children.add(index, node);
-		}
-		else
-		{
-			children.add(node);
-		}
-	}//}}}
-
-	@Override
-	//{{{ getChildren() method
-	public Vector getChildren()
-	{
-		return children;
-	}//}}}
-
-	@Override
-	//{{{ getParent() method
-	public Node getParent()
-	{
-		return parent;
-	}//}}}
-
-	//{{{ setWidth() method
-	public void setWidth(int width)
-	{
-		columnBlockWidth = width;
-	}//}}}
-
-	//{{{ setParent() method
-	public void setParent(Node parent)
-	{
-		this.parent = parent;
-	}//}}}
-
-	//{{{ setLines() method
-	public void setLines(Vector<ColumnBlockLine> lines)
-	{
-		this.lines = lines;
-	}//}}}
-
-	//{{{ getLines() method
-	public Vector<ColumnBlockLine> getLines()
-	{
-		return lines;
-	}//}}}
-
-	//{{{ ColumnBlock() method
-	public ColumnBlock()
-	{
-
-	}//}}}
-
-	//{{{  ColumnBlock() method
-	public ColumnBlock(JEditBuffer buffer, int startLine, int startColumn, int endLine,
-		int endColumn)
-	{
-		super(buffer, startLine, startColumn, endLine, endColumn);
-		this.buffer = buffer;
-	}//}}}
-
-	//{{{  ColumnBlock() method
-	public ColumnBlock(JEditBuffer buffer, int startLine, int endLine)
-	{
-		this.startLine = startLine;
-		this.endLine = endLine;
-		this.buffer = buffer;
-	}//}}}
-
-	//{{{  getStartLine() method
-	@Override
-	public int getStartLine()
-	{
-		return startLine;
-	}//}}}
-
-	//{{{  getEndLine() method
-	@Override
-	public int getEndLine()
-	{
-		return endLine;
-	}//}}}
-
-	//{{{   getColumnWidth() method
-	public int getColumnWidth()
-	{
-		return (int) columnBlockWidth;
-	}//}}}
-
-	//{{{  isLineWithinThisBlock() method
-	public int isLineWithinThisBlock(int line)
-	{
-		if (line < startLine)
-		{
-			return line - startLine;
-		}
-		else if (line > endLine)
-		{
-			return line - endLine;
-		}
-		else
-		{
-			return 0;
-		}
-	}//}}}
-
-	//{{{ getContainingBlock() method
-	public ColumnBlock getContainingBlock(int line, int offset)
-	{
-		ColumnBlock retBlock = null;
-		if (line >= startLine && line <= endLine)
-		{
-			int relativeOffset = offset - buffer.getLineStartOffset(line);
-			if (lines != null && !lines.isEmpty())
-			{
-				ColumnBlockLine blockLine = lines.get(line - startLine);
-				if (blockLine.getColumnEndIndex() >= relativeOffset
-					&& blockLine.getColumnStartIndex() <= relativeOffset)
-				{
-					retBlock = this;
-				}
-			}
-			if (retBlock == null && children != null && !children.isEmpty())
-			{
-				ColumnBlock block = searchChildren(line);
-				if (block != null && block.isLineWithinThisBlock(line) == 0)
-				{
-					retBlock = block.getContainingBlock(line, offset);
-				}
-			}
-		}
-		return retBlock;
-	}//}}}
-
-	//{{{ getContainingBlock() method
-	public ColumnBlock getColumnBlock(int line, int offset)
-	{
-		if (isDirty)
-		{
-			return null;
-		}
-		// int tabSize=-5;
-		synchronized (buffer.columnBlockLock)
-		{
-			ColumnBlock colBlock = null;
-			if (line >= startLine && line <= endLine)
-			{
-				if (lines != null && !lines.isEmpty())
-				{
-					ColumnBlockLine blockLine = lines.get(line - startLine);
-					if (blockLine.getColumnEndIndex() + buffer
-						.getLineStartOffset(line) == offset)
-					{
-						// tabSize =
-						// blockLine.getTabSize();
-						colBlock = this;
-					}
-				}
-				if (colBlock == null && children != null
-					&& !children.isEmpty())
-				{
-					ColumnBlock block = searchChildren(line, 0,
-						children.size() - 1);
-					if (block == null
-						|| block.isLineWithinThisBlock(line) != 0)
-					{
-						throwException(offset, line);
-					}
-					// tabSize =
-					// block.getColumnBlock(line,offset);
-					colBlock = block.getColumnBlock(line, offset);
-				}
-			}
-			// if(tabSize<0)
-			if (colBlock == null)
-				throwException(offset, line);
-			// return tabSize;
-			return colBlock;
-		}
-
-	}//}}}
-
-	//{{{ searchChildren() method
-	public ColumnBlock searchChildren(int line)
-	{
-		if (children != null && !children.isEmpty())
-		{
-			return searchChildren(line, 0, children.size() - 1);
-		}
-		else
-		{
-			return null;
-		}
-	}//}}}
-
-	//{{{ searchChildren() method
-	/*
-	 * binary search on a sorted list searches the children for one
-	 * containing the line no. line returns an exact match or the closest
-	 * column block just below this line use isLineWithinThisBlock on the
-	 * column block returned by this method to determine whether there was
-	 * an exact match
-	 */
-	private ColumnBlock searchChildren(int line, int startIndex, int stopIndex)
-	{
-		if (children != null)
-		{
-			if (startIndex > stopIndex)
-			{
-				// no exact match found return the nearest
-				// column block just below this line
-				return (ColumnBlock) children.get(startIndex);
-			}
-			int currentSearchIndex = (startIndex + stopIndex) / 2;
-			int found = ((ColumnBlock) children.get(currentSearchIndex))
-				.isLineWithinThisBlock(line);
-			if (found == 0)
-			{
-				return (ColumnBlock) children.get(currentSearchIndex);
-			}
-			else if (found > 0)
-			{
-				if (children.size() - 1 > currentSearchIndex)
-				{
-					return searchChildren(line, currentSearchIndex + 1,
-						stopIndex);
-				}
-				else
-				{
-					return null;
-				}
-			}
-			else if (found < 0)
-			{
-				if (currentSearchIndex > 0)
-				{
-					return searchChildren(line, startIndex,
-						currentSearchIndex - 1);
-				}
-				else
-				{
-					// no exact match found return the
-					// nearest column block just below this
-					// line
-					return (ColumnBlock) children.get(0);
-				}
-			}
-		}
-		return null;
-	}//}}}
-	
-	//{{{ toString() method
-	public String toString()
-	{
-		StringBuilder buf = new StringBuilder();
-		buf.append("ColumnBlock[startLine : ").append(startLine).append(" ,endLine : ").append(endLine)
-		   .append(" ,columnBlockWidth : ").append(columnBlockWidth).append("] LINES:");
-		for (int i = 0; i < lines.size(); i++)
-		{
-			buf.append('\n');
-			buf.append("LINE ").append(i).append(':').append(lines.elementAt(i));
-		}
-
-		for (int i = 0; i < children.size(); i++)
-		{
-			buf.append('\n');
-			buf.append("CHILD ").append(i).append(':').append(children.elementAt(i));
-		}
-		return buf.toString();
-	}//}}}
-
-	//{{{ throwException() method
-	private void throwException(int offset, int line)
-	{
-		throw new IllegalArgumentException("{ELSTIC TABSTOP}CORRUPT DATA@{"
-			+ System.currentTimeMillis() + "} & Thread : "
-			+ Thread.currentThread().getName()
-			+ " :Cannot find the size for tab at offset "
-			+ (offset - buffer.getLineStartOffset(line)) + "in line " + line
-			+ "while searching in \n " + this);
-	}//}}}
-
-	//{{{ setDirtyStatus() method
-	public void setDirtyStatus(boolean status)
-	{
-		synchronized (buffer.columnBlockLock)
-		{
-			isDirty = status;
-		}
-	}//}}}
-
-	//{{{ updateLineNo() method
-	public void updateLineNo(int line)
-	{
-		// Things to do in this method
-		// update line no. in this column block
-		// update column block lines in this column block
-		// call this method on all children
-		startLine += line;
-		endLine += line;
-
-		for (int i = 0; i < lines.size(); i++)
-		{
-			lines.elementAt(i).updateLineNo(line);
-		}
-
-		for (int i = 0; i < children.size(); i++)
-		{
-			((ColumnBlock) children.elementAt(i)).updateLineNo(line);
-		}
-	}//}}}
-
-	//{{{ updateColumnBlockLineOffset() method
-	public void updateColumnBlockLineOffset(int line, int offsetAdd, boolean increaseStartOffset)
-	{
-		if (line >= startLine && line <= endLine)
-		{
-			if (lines != null && !lines.isEmpty())
-			{
-				ColumnBlockLine blockLine = lines.get(line - startLine);
-				if (increaseStartOffset)
-				{
-					blockLine.colStartIndex += offsetAdd;
-				}
-				blockLine.colEndIndex += offsetAdd;
-			}
-			if (children != null && !children.isEmpty())
-			{
-				ColumnBlock block = searchChildren(line);
-				if (block != null && block.isLineWithinThisBlock(line) == 0)
-				{
-					block.updateColumnBlockLineOffset(line, offsetAdd, true);
-				}
-			}
-		}
-	}//}}}
-	
-	//{{{ setTabSizeDirtyStatus() method
-	/*
-	 * tab sizes become dirty on font changes or when char is added or
-	 * deleted inside ColumnBlock they become clean once they get calculated
-	 * again inside the tab expander
-	 */
-	public void setTabSizeDirtyStatus(boolean dirty, boolean recursive)
-	{
-		tabSizesDirty = dirty;
-		if (recursive && children != null && !children.isEmpty())
-		{
-			for (int i = 0; i < children.size(); i++)
-			{
-				((ColumnBlock) children.elementAt(i)).setTabSizeDirtyStatus(true,
-					true);
-			}
-		}
-	}//}}}
-
-	//{{{ areTabSizesDirty() method
-	public boolean areTabSizesDirty()
-	{
-		return tabSizesDirty;
-	}//}}}
-}
+/*
+ * ColumnBlock.java 
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010 Anshal Shukla
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.textarea;
+
+import java.util.Vector;
+
+import org.gjt.sp.jedit.buffer.JEditBuffer;
+import org.gjt.sp.jedit.textarea.Selection.Rect;
+
+public class ColumnBlock extends Rect implements Node
+{
+	private Node parent;
+
+	private Vector<Node> children = new Vector<Node>();
+
+	private Vector<ColumnBlockLine> lines = new Vector<ColumnBlockLine>();
+
+	float columnBlockWidth;
+
+	private boolean tabSizesDirty = true;
+
+	private JEditBuffer buffer;
+
+	private boolean isDirty;
+
+	@Override
+	//{{{ addChild() method
+	public void addChild(Node node)
+	{
+		// must add the children in sorted order
+		ColumnBlock block = (ColumnBlock) node;
+		ColumnBlock blockBelow = searchChildren(block.startLine);
+		if (blockBelow != null)
+		{
+			if (blockBelow.isLineWithinThisBlock(block.endLine) >= 0)
+			{
+				throw new IllegalArgumentException("Overlapping column blocks: "
+					+ block + " \n&\n" + blockBelow);
+			}
+			int index = children.indexOf(blockBelow);
+			children.add(index, node);
+		}
+		else
+		{
+			children.add(node);
+		}
+	}//}}}
+
+	@Override
+	//{{{ getChildren() method
+	public Vector<Node> getChildren()
+	{
+		return children;
+	}//}}}
+
+	@Override
+	//{{{ getParent() method
+	public Node getParent()
+	{
+		return parent;
+	}//}}}
+
+	//{{{ setWidth() method
+	public void setWidth(int width)
+	{
+		columnBlockWidth = width;
+	}//}}}
+
+	//{{{ setParent() method
+	public void setParent(Node parent)
+	{
+		this.parent = parent;
+	}//}}}
+
+	//{{{ setLines() method
+	public void setLines(Vector<ColumnBlockLine> lines)
+	{
+		this.lines = lines;
+	}//}}}
+
+	//{{{ getLines() method
+	public Vector<ColumnBlockLine> getLines()
+	{
+		return lines;
+	}//}}}
+
+	//{{{ ColumnBlock() method
+	public ColumnBlock()
+	{
+
+	}//}}}
+
+	//{{{  ColumnBlock() method
+	public ColumnBlock(JEditBuffer buffer, int startLine, int startColumn, int endLine,
+		int endColumn)
+	{
+		super(buffer, startLine, startColumn, endLine, endColumn);
+		this.buffer = buffer;
+	}//}}}
+
+	//{{{  ColumnBlock() method
+	public ColumnBlock(JEditBuffer buffer, int startLine, int endLine)
+	{
+		this.startLine = startLine;
+		this.endLine = endLine;
+		this.buffer = buffer;
+	}//}}}
+
+	//{{{  getStartLine() method
+	@Override
+	public int getStartLine()
+	{
+		return startLine;
+	}//}}}
+
+	//{{{  getEndLine() method
+	@Override
+	public int getEndLine()
+	{
+		return endLine;
+	}//}}}
+
+	//{{{   getColumnWidth() method
+	public int getColumnWidth()
+	{
+		return (int) columnBlockWidth;
+	}//}}}
+
+	//{{{  isLineWithinThisBlock() method
+	public int isLineWithinThisBlock(int line)
+	{
+		if (line < startLine)
+		{
+			return line - startLine;
+		}
+		else if (line > endLine)
+		{
+			return line - endLine;
+		}
+		else
+		{
+			return 0;
+		}
+	}//}}}
+
+	//{{{ getContainingBlock() method
+	public ColumnBlock getContainingBlock(int line, int offset)
+	{
+		ColumnBlock retBlock = null;
+		if (line >= startLine && line <= endLine)
+		{
+			int relativeOffset = offset - buffer.getLineStartOffset(line);
+			if (lines != null && !lines.isEmpty())
+			{
+				ColumnBlockLine blockLine = lines.get(line - startLine);
+				if (blockLine.getColumnEndIndex() >= relativeOffset
+					&& blockLine.getColumnStartIndex() <= relativeOffset)
+				{
+					retBlock = this;
+				}
+			}
+			if (retBlock == null && children != null && !children.isEmpty())
+			{
+				ColumnBlock block = searchChildren(line);
+				if (block != null && block.isLineWithinThisBlock(line) == 0)
+				{
+					retBlock = block.getContainingBlock(line, offset);
+				}
+			}
+		}
+		return retBlock;
+	}//}}}
+
+	//{{{ getContainingBlock() method
+	public ColumnBlock getColumnBlock(int line, int offset)
+	{
+		if (isDirty)
+		{
+			return null;
+		}
+		// int tabSize=-5;
+		synchronized (buffer.columnBlockLock)
+		{
+			ColumnBlock colBlock = null;
+			if (line >= startLine && line <= endLine)
+			{
+				if (lines != null && !lines.isEmpty())
+				{
+					ColumnBlockLine blockLine = lines.get(line - startLine);
+					if (blockLine.getColumnEndIndex() + buffer
+						.getLineStartOffset(line) == offset)
+					{
+						// tabSize =
+						// blockLine.getTabSize();
+						colBlock = this;
+					}
+				}
+				if (colBlock == null && children != null
+					&& !children.isEmpty())
+				{
+					ColumnBlock block = searchChildren(line, 0,
+						children.size() - 1);
+					if (block == null
+						|| block.isLineWithinThisBlock(line) != 0)
+					{
+						throwException(offset, line);
+					}
+					// tabSize =
+					// block.getColumnBlock(line,offset);
+					colBlock = block.getColumnBlock(line, offset);
+				}
+			}
+			// if(tabSize<0)
+			if (colBlock == null)
+				throwException(offset, line);
+			// return tabSize;
+			return colBlock;
+		}
+
+	}//}}}
+
+	//{{{ searchChildren() method
+	public ColumnBlock searchChildren(int line)
+	{
+		if (children != null && !children.isEmpty())
+		{
+			return searchChildren(line, 0, children.size() - 1);
+		}
+		else
+		{
+			return null;
+		}
+	}//}}}
+
+	//{{{ searchChildren() method
+	/*
+	 * binary search on a sorted list searches the children for one
+	 * containing the line no. line returns an exact match or the closest
+	 * column block just below this line use isLineWithinThisBlock on the
+	 * column block returned by this method to determine whether there was
+	 * an exact match
+	 */
+	private ColumnBlock searchChildren(int line, int startIndex, int stopIndex)
+	{
+		if (children != null)
+		{
+			if (startIndex > stopIndex)
+			{
+				// no exact match found return the nearest
+				// column block just below this line
+				return (ColumnBlock) children.get(startIndex);
+			}
+			int currentSearchIndex = (startIndex + stopIndex) / 2;
+			int found = ((ColumnBlock) children.get(currentSearchIndex))
+				.isLineWithinThisBlock(line);
+			if (found == 0)
+			{
+				return (ColumnBlock) children.get(currentSearchIndex);
+			}
+			else if (found > 0)
+			{
+				if (children.size() - 1 > currentSearchIndex)
+				{
+					return searchChildren(line, currentSearchIndex + 1,
+						stopIndex);
+				}
+				else
+				{
+					return null;
+				}
+			}
+			else if (found < 0)
+			{
+				if (currentSearchIndex > 0)
+				{
+					return searchChildren(line, startIndex,
+						currentSearchIndex - 1);
+				}
+				else
+				{
+					// no exact match found return the
+					// nearest column block just below this
+					// line
+					return (ColumnBlock) children.get(0);
+				}
+			}
+		}
+		return null;
+	}//}}}
+	
+	//{{{ toString() method
+	public String toString()
+	{
+		StringBuilder buf = new StringBuilder();
+		buf.append("ColumnBlock[startLine : ").append(startLine).append(" ,endLine : ").append(endLine)
+		   .append(" ,columnBlockWidth : ").append(columnBlockWidth).append("] LINES:");
+		for (int i = 0; i < lines.size(); i++)
+		{
+			buf.append('\n');
+			buf.append("LINE ").append(i).append(':').append(lines.elementAt(i));
+		}
+
+		for (int i = 0; i < children.size(); i++)
+		{
+			buf.append('\n');
+			buf.append("CHILD ").append(i).append(':').append(children.elementAt(i));
+		}
+		return buf.toString();
+	}//}}}
+
+	//{{{ throwException() method
+	private void throwException(int offset, int line)
+	{
+		throw new IllegalArgumentException("{ELASTIC TABSTOP}CORRUPT DATA@{"
+			+ System.currentTimeMillis() + "} & Thread : "
+			+ Thread.currentThread().getName()
+			+ " :Cannot find the size for tab at offset "
+			+ (offset - buffer.getLineStartOffset(line)) + "in line " + line
+			+ "while searching in \n " + this);
+	}//}}}
+
+	//{{{ setDirtyStatus() method
+	public void setDirtyStatus(boolean status)
+	{
+		synchronized (buffer.columnBlockLock)
+		{
+			isDirty = status;
+		}
+	}//}}}
+
+	//{{{ updateLineNo() method
+	public void updateLineNo(int line)
+	{
+		// Things to do in this method
+		// update line no. in this column block
+		// update column block lines in this column block
+		// call this method on all children
+		startLine += line;
+		endLine += line;
+
+		for (int i = 0; i < lines.size(); i++)
+		{
+			lines.elementAt(i).updateLineNo(line);
+		}
+
+		for (int i = 0; i < children.size(); i++)
+		{
+			((ColumnBlock) children.elementAt(i)).updateLineNo(line);
+		}
+	}//}}}
+
+	//{{{ updateColumnBlockLineOffset() method
+	public void updateColumnBlockLineOffset(int line, int offsetAdd, boolean increaseStartOffset)
+	{
+		if (line >= startLine && line <= endLine)
+		{
+			if (lines != null && !lines.isEmpty())
+			{
+				ColumnBlockLine blockLine = lines.get(line - startLine);
+				if (increaseStartOffset)
+				{
+					blockLine.colStartIndex += offsetAdd;
+				}
+				blockLine.colEndIndex += offsetAdd;
+			}
+			if (children != null && !children.isEmpty())
+			{
+				ColumnBlock block = searchChildren(line);
+				if (block != null && block.isLineWithinThisBlock(line) == 0)
+				{
+					block.updateColumnBlockLineOffset(line, offsetAdd, true);
+				}
+			}
+		}
+	}//}}}
+	
+	//{{{ setTabSizeDirtyStatus() method
+	/*
+	 * tab sizes become dirty on font changes or when char is added or
+	 * deleted inside ColumnBlock they become clean once they get calculated
+	 * again inside the tab expander
+	 */
+	public void setTabSizeDirtyStatus(boolean dirty, boolean recursive)
+	{
+		tabSizesDirty = dirty;
+		if (recursive && children != null && !children.isEmpty())
+		{
+			for (int i = 0; i < children.size(); i++)
+			{
+				((ColumnBlock) children.elementAt(i)).setTabSizeDirtyStatus(true,
+					true);
+			}
+		}
+	}//}}}
+
+	//{{{ areTabSizesDirty() method
+	public boolean areTabSizesDirty()
+	{
+		return tabSizesDirty;
+	}//}}}
+}
diff --git a/org/gjt/sp/jedit/textarea/ColumnBlockLine.java b/org/gjt/sp/jedit/textarea/ColumnBlockLine.java
index 6213a57..169ec4d 100644
--- a/org/gjt/sp/jedit/textarea/ColumnBlockLine.java
+++ b/org/gjt/sp/jedit/textarea/ColumnBlockLine.java
@@ -1,79 +1,79 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2010 jEdit contributors
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.textarea;
-
-public class ColumnBlockLine
-{
-	private int line;
-	int colStartIndex;
-	int colEndIndex;
-	float lineLength;
-	
-	//{{{ ColumnBlockLine() method
-	public ColumnBlockLine(int line,int lineStartIndex,int lineEndIndex)
-	{
-		this.line = line;
-		this.colEndIndex  = lineEndIndex;
-		this.colStartIndex = lineStartIndex;
-	}//}}}
-	
-	//{{{  getLine() method
-	public int getLine()
-	{
-		return line;
-	}//}}}
-	
-	//{{{ getColumnStartIndex() method
-	public int getColumnStartIndex()
-	{
-		return colStartIndex;
-	}//}}}
-	
-	//{{{ getColumnEndIndex() method
-	public int getColumnEndIndex()
-	{
-		return colEndIndex;
-	}//}}}
-	
-	//{{{ setLineLength() method
-	public void setLineLength(float lineLength)
-	{
-		this.lineLength = lineLength;
-	}//}}}
-	
-	//{{{  getLineLength() method
-	public float getLineLength()
-	{
-		return lineLength;
-	}//}}}
-	
-	//{{{ toString() method
-	public String toString()
-	{
-		return "[ColumnBlockLine]colStartIndex:"+colStartIndex+"  colEndIndex:"+ colEndIndex+" lineLength:"+lineLength+" line:"+line;
-	}//}}}
-	
-	//{{{ updateLineNo() method
-	public void updateLineNo(int line )
-	{
-		this.line+=line;
-	}//}}}
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2010 jEdit contributors
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.textarea;
+
+public class ColumnBlockLine
+{
+	private int line;
+	int colStartIndex;
+	int colEndIndex;
+	float lineLength;
+	
+	//{{{ ColumnBlockLine() method
+	public ColumnBlockLine(int line,int lineStartIndex,int lineEndIndex)
+	{
+		this.line = line;
+		this.colEndIndex  = lineEndIndex;
+		this.colStartIndex = lineStartIndex;
+	}//}}}
+	
+	//{{{  getLine() method
+	public int getLine()
+	{
+		return line;
+	}//}}}
+	
+	//{{{ getColumnStartIndex() method
+	public int getColumnStartIndex()
+	{
+		return colStartIndex;
+	}//}}}
+	
+	//{{{ getColumnEndIndex() method
+	public int getColumnEndIndex()
+	{
+		return colEndIndex;
+	}//}}}
+	
+	//{{{ setLineLength() method
+	public void setLineLength(float lineLength)
+	{
+		this.lineLength = lineLength;
+	}//}}}
+	
+	//{{{  getLineLength() method
+	public float getLineLength()
+	{
+		return lineLength;
+	}//}}}
+	
+	//{{{ toString() method
+	public String toString()
+	{
+		return "[ColumnBlockLine]colStartIndex:"+colStartIndex+"  colEndIndex:"+ colEndIndex+" lineLength:"+lineLength+" line:"+line;
+	}//}}}
+	
+	//{{{ updateLineNo() method
+	public void updateLineNo(int line )
+	{
+		this.line+=line;
+	}//}}}
+}
diff --git a/org/gjt/sp/jedit/textarea/DisplayManager.java b/org/gjt/sp/jedit/textarea/DisplayManager.java
index 4bd184b..1a02795 100644
--- a/org/gjt/sp/jedit/textarea/DisplayManager.java
+++ b/org/gjt/sp/jedit/textarea/DisplayManager.java
@@ -1,6 +1,6 @@
 /*
  * DisplayManager.java - Low-level text display
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2005 Slava Pestov
@@ -35,7 +35,7 @@ import org.gjt.sp.util.Log;
  * 
  * @since jEdit 4.2pre1
  * @author Slava Pestov
- * @version $Id: DisplayManager.java 22366 2012-10-13 22:21:34Z ezust $
+ * @version $Id: DisplayManager.java 22670 2013-01-12 12:29:48Z thomasmey $
  */
 public class DisplayManager
 {
@@ -655,6 +655,8 @@ public class DisplayManager
 
 		if(!screenLineMgr.isScreenLineCountValid(line))
 		{
+			// reset chunk cache here
+			textArea.chunkCache.reset();
 			int newCount = textArea.chunkCache.getLineSubregionCount(line);
 
 			assert newCount > 0;
diff --git a/org/gjt/sp/jedit/textarea/ElasticTabStopBufferListener.java b/org/gjt/sp/jedit/textarea/ElasticTabStopBufferListener.java
index 43efd2f..44a1606 100644
--- a/org/gjt/sp/jedit/textarea/ElasticTabStopBufferListener.java
+++ b/org/gjt/sp/jedit/textarea/ElasticTabStopBufferListener.java
@@ -1,544 +1,541 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2010 jEdit contributors
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.textarea;
-
-import java.util.Vector;
-
-import javax.swing.text.Segment;
-
-import org.gjt.sp.jedit.buffer.BufferAdapter;
-import org.gjt.sp.jedit.buffer.JEditBuffer;
-import org.gjt.sp.jedit.textarea.TextArea;
-
-/** Buffer Listener for Elastic Tabstops.  
-  */
-public class ElasticTabStopBufferListener extends BufferAdapter
-{
-	TextArea textArea;
-	
-	private boolean handledInsertion = true;
-	private boolean handledDeletion = true;
-	private boolean singleTabDeleted = false;
-	
-	//{{{ ElasticTabStopBufferListener() method
-	public ElasticTabStopBufferListener(TextArea textArea)
-	{
-		this.textArea = textArea;
-	}//}}}
-	
-	//{{{ fullyUpdateColumnBlocks() method
-	private void fullyUpdateColumnBlocks(JEditBuffer buffer)
-	{
-		buffer.indentUsingElasticTabstops();
-		handledInsertion = true;
-		handledDeletion = true;
-		buffer.getColumnBlock().setDirtyStatus(false);
-		textArea.chunkCache.invalidateChunksFromPhys(0);
-		textArea.invalidateLineRange(0, buffer.getLineCount()-1);
-		//textArea.getPainter().repaint();
-	}//}}}
-	
-	//{{{ contentInserted() method
-	public void contentInserted(JEditBuffer buffer, int startLine, int offset,
-			int numLines, int length) 
-	{
-		if(!buffer.getBooleanProperty("elasticTabstops"))
-		{
-			return;
-		}
-		String charDeleted;
-		boolean isASimpleChar = false;
-		boolean singleTabInserted = false;
-		if((numLines==0)&(length==1))
-		{
-			isASimpleChar = true;
-			charDeleted = buffer.getText(offset, length);
-			if(charDeleted.equals("\t"))
-			{
-				singleTabInserted  = true;
-			}
-		}
-		ColumnBlock rootBlock = buffer.getColumnBlock();
-		if(rootBlock==null)
-		{
-			return;
-		}
-		//System.out.println("BEFORE UPDATING COLUMN BLOCKS-----");
-		//System.out.println(rootBlock);
-		int indexofBlockAbove = -1;
-		ColumnBlock block = rootBlock.searchChildren(startLine);
-		ColumnBlock blockjustAbove = null;
-		boolean liesWithinBlock = false;
-		int startIndex =-1;
-		if(block!=null)
-		{	
-			startIndex =  rootBlock.getChildren().indexOf(block);
-			indexofBlockAbove=startIndex-1;
-			if(block.isLineWithinThisBlock(startLine)==0)
-			{
-				//if the line lies within this block we need to redraw it
-				startIndex++;
-				liesWithinBlock = true;
-			}
-		}
-		else
-		{
-			startIndex = rootBlock.getChildren().size();
-			indexofBlockAbove = startIndex-1;
-		}
-		
-		if(indexofBlockAbove>=0&&((ColumnBlock)(rootBlock.getChildren().get(indexofBlockAbove))).endLine+1==startLine)
-		{
-			blockjustAbove = (ColumnBlock)(rootBlock.getChildren().get(indexofBlockAbove));
-		}
-		if(numLines>0)
-		{	
-			rootBlock.endLine +=  numLines;
-			for(int i=startIndex;i<rootBlock.getChildren().size();i++)
-			{
-				((ColumnBlock)(rootBlock.getChildren().get(i))).updateLineNo(numLines);
-			}
-		}
-		int startingLine =-1;
-		int endLine = -1;
-		if(liesWithinBlock)
-		{
-			ColumnBlock innerContainingBlock = block.getContainingBlock(startLine, offset);
-			if((isASimpleChar)&&!(innerContainingBlock==null&&singleTabInserted))
-			{
-				//a simple char has been entered (no newline )
-				//if this lies inside a column block update the startIndex and endIndex of this blocks corresponding ColumnBlockLine
-				//and all subsequent ColumnBlock Lines after this one
-				//check whether columnBlockWidth is valid 
-				
-				//do nothing if this char does not lie inside a column block
-				if(innerContainingBlock!=null)
-				{
-					if(!singleTabInserted)
-					{	
-						innerContainingBlock.updateColumnBlockLineOffset(startLine, length, false);
-						ColumnBlockLine containingLine = innerContainingBlock.getLines().elementAt(startLine-innerContainingBlock.startLine);
-						startingLine = innerContainingBlock.startLine;
-						innerContainingBlock.setTabSizeDirtyStatus(true,false);
-						endLine = innerContainingBlock.endLine;
-					}
-					else
-					{
-						//no need to update line offset as ColumnBlock would be rebuilt
-						ColumnBlock innerParent = (ColumnBlock)innerContainingBlock.getParent();
-						//startingLine = innerContainingBlock.startLine;
-						//endLine = innerContainingBlock.endLine;
-						//innerParent.getChildren().remove(innerContainingBlock);
-						startingLine =  innerParent.startLine;
-						endLine =  innerParent.endLine;
-						innerParent.getChildren().removeAllElements();
-						buffer.updateColumnBlocks(startingLine, endLine,(int)innerParent.columnBlockWidth , innerParent);
-					}
-					
-				}
-				/*else if(innerContainingBlock==null&&singleTabInserted)
-				{
-					//TODO handle this case when tab has been inserted in FRONT and not OUTSIDE of a column block
-					//currently whole column block gets repainted in this case
-				}*/
-				else
-				{
-					//this line must have been  retokenized and repainted by the BufferHandler so repaint it again here after column blocks dirty status is updated 
-					startingLine = startLine;
-					endLine = startLine;
-				}
-			}
-			if((!isASimpleChar)||(innerContainingBlock==null&&singleTabInserted))
-			{	
-				startingLine = block.getStartLine();
-				endLine = block.getEndLine()+numLines;
-				rootBlock.getChildren().remove(block);
-				buffer.updateColumnBlocks(startingLine, endLine, 0, rootBlock);
-			}	
-		}
-		else
-		{
-			Segment seg  = new Segment();
-			buffer.getText(offset, length, seg);
-			if(buffer.getTabStopPosition(seg)>=0)
-			{
-				if(blockjustAbove!=null)
-				{
-					rootBlock.getChildren().remove(blockjustAbove);
-					startingLine=blockjustAbove.startLine;
-				}
-				else
-				{
-					startingLine=startLine;
-				}
-				
-				if((block!=null)&&(block.startLine==startLine+numLines+1))
-				{
-					rootBlock.getChildren().remove(block);
-					endLine = block.endLine;
-				}
-				else
-				{
-					endLine = startLine + numLines;
-				}
-				buffer.updateColumnBlocks(startingLine, endLine, 0, rootBlock);
-			}
-			
-		}
-		handledInsertion = true;
-		rootBlock.setDirtyStatus(false);
-		//System.out.println("AFTER UPDATING COLUMN BLOCKS-----");
-		//System.out.println(rootBlock);
-		if(startingLine!=-1&&endLine!=-1&&handledDeletion)
-		{	
-			textArea.chunkCache.invalidateChunksFromPhys(startingLine);
-			textArea.invalidateLineRange(startingLine, endLine);
-		}
-	}//}}}
-
-	//{{{ contentRemoved() method
-	/**
-	 * Called when text is removed from the buffer.
-	 * @param buffer The buffer in question
-	 * @param startLine The first line
-	 * @param offset The start offset, from the beginning of the buffer
-	 * @param numLines The number of lines removed
-	 * @param length The number of characters removed
-	 * @since jEdit 4.3pre3
-	 */
-	public void contentRemoved(JEditBuffer buffer, int startLine, int offset,
-		int numLines, int length)
-	{
-		if(!buffer.getBooleanProperty("elasticTabstops"))
-		{
-			return;
-		}
-		String charDeleted;
-		boolean isASimpleChar = false;
-		ColumnBlock rootBlock = buffer.getColumnBlock();
-		if(rootBlock==null)
-		{
-			return;
-		}
-		if((numLines==0)&(length==1))
-		{
-			isASimpleChar = true;
-		}
-		if((!isASimpleChar))
-		{
-			//we need to remove column blocks
-			//find the column block lying just below the first line deleted
-			ColumnBlock firstBlockEffected = rootBlock.searchChildren(startLine);
-			//info we need to determine inside this if block
-			int startLineToBuild = -1;
-			int endLineToBuild = -1;
-			ColumnBlock firstBlockToBeUpdated = null;
-			ColumnBlock firstBlockToBeRemoved = null;
-			ColumnBlock lastBlockToBeRemoved = null;
-			if(firstBlockEffected!=null)
-			{
-				int indexFirstBlockEffected =rootBlock.getChildren().indexOf(firstBlockEffected);
-				ColumnBlock blockAboveFirstEffected = null;
-				boolean justBelowBlock = false;
-				if(indexFirstBlockEffected>0)
-				{
-					blockAboveFirstEffected = (ColumnBlock)rootBlock.getChildren().get(indexFirstBlockEffected-1);
-					if(blockAboveFirstEffected.endLine==startLine-1 )
-					{
-						justBelowBlock  = true;
-					}
-				}
-				int posFirstLine =  firstBlockEffected.isLineWithinThisBlock(startLine);
-				boolean firstLineLiesInside =posFirstLine==0;
-				boolean firstLineLiesAbove =posFirstLine<0;
-				int posLastLine =  firstBlockEffected.isLineWithinThisBlock(startLine+numLines);
-				boolean lastLineLiesInside =posLastLine==0;
-				boolean lastLineLiesAbove = posLastLine<0;
-				boolean lastLineLiesBelow = posLastLine>0;
-				//deletion above block
-				if(lastLineLiesAbove )
-				{
-					//if last line lies above this block cannot be connected to a block above in this deletion without touching the block above
-					/*if(justBelowBlock&&startLine+numLines+1==firstBlockEffected.startLine)
-					{
-						startLineToBuild=blockAboveFirstEffected.startLine;
-						endLineToBuild= firstBlockEffected.endLine;
-						firstBlockToBeRemoved = blockAboveFirstEffected;
-						lastBlockToBeRemoved = firstBlockEffected;
-					}*/
-					firstBlockToBeUpdated = firstBlockEffected;
-					//else
-					//{	
-						firstBlockToBeRemoved =lastBlockToBeRemoved= null;
-						startLineToBuild=endLineToBuild=-1;
-					//}	
-				}
-				//deletion inside block
-				else if((firstLineLiesInside||firstLineLiesAbove)&&lastLineLiesInside)
-				{
-					startLineToBuild = Math.min( firstBlockEffected.startLine,startLine);
-					endLineToBuild = firstBlockEffected.endLine-numLines;
-					//if(indexFirstBlockEffected<rootBlock.getChildren().size()-1)
-					//{	
-						//firstBlockToBeUpdated =(ColumnBlock)rootBlock.getChildren().get(indexFirstBlockEffected+1) ;
-					//}	
-					firstBlockToBeRemoved =lastBlockToBeRemoved= firstBlockEffected;
-					if(justBelowBlock)
-					{
-						startLineToBuild =blockAboveFirstEffected.startLine ;
-						firstBlockToBeRemoved = blockAboveFirstEffected;
-					}
-				}
-				//deletion might cover other blocks as well
-				else if(((firstLineLiesInside)||(firstLineLiesAbove))&&lastLineLiesBelow)
-				{
-					startLineToBuild = Math.min(startLine, firstBlockEffected.startLine);
-					firstBlockToBeRemoved = firstBlockEffected;
-					ColumnBlock blockBelow = rootBlock.searchChildren(startLine+numLines);
-					int indexLastBlock = rootBlock.getChildren().indexOf(blockBelow);
-					if(blockBelow!=null)
-					{
-						//deletion partially overlaps this block
-						if(blockBelow.isLineWithinThisBlock(startLine+numLines)==0)
-						{
-							if(justBelowBlock)
-							{
-								startLineToBuild =blockAboveFirstEffected.startLine ;
-								firstBlockToBeRemoved = blockAboveFirstEffected;
-							}
-							lastBlockToBeRemoved = blockBelow;
-							endLineToBuild = blockBelow.endLine-numLines;
-							//if(indexLastBlock<rootBlock.getChildren().size()-1)
-							//{
-								//firstBlockToBeUpdated = (ColumnBlock)rootBlock.getChildren().get(indexLastBlock+1);
-							//}
-						}
-						
-						//deletion lies above this block
-						else 
-						{
-							//do not need to consider blockJustAbove here as we cannot connect two column blocks without 
-							//ending on one of the lines of either
-							//firstBlockToBeUpdated = blockBelow;
-							//if we have reached here there is surely a block above this one 
-							lastBlockToBeRemoved = (ColumnBlock)rootBlock.getChildren().get(indexLastBlock-1);
-							//if the first Block is wholly covered then all column blocks are being deleted completely and there is nothing to build
-							endLineToBuild = firstLineLiesAbove?-1:startLine;
-							//consider the case where last line deleted is just above the column block block below
-							if((blockBelow.startLine==startLine+numLines+1)&&(endLineToBuild!=-1))
-							{
-								endLineToBuild = blockBelow.endLine-numLines;
-								lastBlockToBeRemoved = blockBelow;
-							}
-							if(endLineToBuild==-1)
-							{
-								startLineToBuild = -1;
-							}
-						}
-					}
-					//no block below last line
-					else
-					{
-						lastBlockToBeRemoved = (ColumnBlock)rootBlock.getChildren().get(rootBlock.getChildren().size()-1);
-						//firstBlockToBeUpdated = null;
-						if(firstLineLiesInside)
-						{	
-							endLineToBuild = startLine;
-						}
-						else
-						{
-							startLineToBuild = -1;
-							endLineToBuild= -1;
-						}
-					} 
-				}
-			}
-			//deletion lies below all column blocks
-			else
-			{
-				 startLineToBuild = -1;
-				 endLineToBuild = -1;
-				 //firstBlockToBeUpdated = null;
-				 firstBlockToBeRemoved = null;
-				 lastBlockToBeRemoved = null;
-			}
-			//once we reach here we have three things to do
-			//1)delete columnBlocks using firstBlockToBeDeleted and lastBlockToBeDeleted
-			Vector blocksToBeRemoved =null;
-			if(firstBlockToBeRemoved!=null)
-			{
-				int startIndex = rootBlock.getChildren().indexOf(firstBlockToBeRemoved);
-				blocksToBeRemoved = new Vector();
-				if(lastBlockToBeRemoved==null)
-				{
-					throw new IllegalArgumentException("Deletion not handled properly");
-				}
-				int endIndex = rootBlock.getChildren().indexOf(lastBlockToBeRemoved);
-				for(int i=startIndex;i<=endIndex;i++)
-				{
-					blocksToBeRemoved.add(rootBlock.getChildren().get(i));
-				}
-					
-			}	
-			//2)update startLine/endLine in column blocks using firstBlockToBeUpdated
-			if(numLines>0)
-			{	
-				rootBlock.endLine-=numLines;
-				if((lastBlockToBeRemoved!=null)||(firstBlockToBeUpdated!=null))
-				{
-					int startIndex=-1;
-					if(lastBlockToBeRemoved!=null)
-					{
-						startIndex = rootBlock.getChildren().indexOf(lastBlockToBeRemoved);
-						//start just after the last block to be removed
-						startIndex++;
-					}
-					else if(firstBlockToBeUpdated!=null)
-					{
-						startIndex = rootBlock.getChildren().indexOf(firstBlockToBeUpdated);
-					}
-					for(int i=startIndex;i<rootBlock.getChildren().size();i++)
-					{	
-						((ColumnBlock)rootBlock.getChildren().get(i)).updateLineNo(-1*numLines);
-					}	
-				}
-			}
-			//once we are done with (2) we can safely change rootBlock
-			if(blocksToBeRemoved!=null)
-			{	
-				rootBlock.getChildren().removeAll(blocksToBeRemoved);
-			}	
-			//3)rebuild column blocks using endLine and startLine
-			if(startLineToBuild!=-1&&endLineToBuild!=-1)
-			{	
-				buffer.updateColumnBlocks(startLineToBuild, endLineToBuild, 0, rootBlock);
-				rootBlock.setDirtyStatus(false);
-				textArea.chunkCache.invalidateChunksFromPhys(startLineToBuild);
-				textArea.invalidateLineRange(startLineToBuild, endLineToBuild);
-			}
-			rootBlock.setDirtyStatus(false);
-			handledDeletion = true;
-		}
-		else
-		{
-			int startingLine = -1;
-			int endLine = -1;
-			//a simple char has been entered 
-			//if this lies inside a column block update the startIndex and endIndex of this blocks corresponding ColumnBlockLine
-			//and all subsequent ColumnBlock Lines after this one
-			//check whether columnBlockWidth is valid 
-			ColumnBlock innerContainingBlock = rootBlock.getContainingBlock(startLine, offset);
-			//do nothing if this char does not lie inside a column block
-			if(innerContainingBlock!=null)
-			{
-				if(!singleTabDeleted)
-				{	
-					innerContainingBlock.updateColumnBlockLineOffset(startLine, -1*length, false);
-					ColumnBlockLine containingLine = innerContainingBlock.getLines().elementAt(startLine-innerContainingBlock.startLine);
-					startingLine = innerContainingBlock.startLine;
-					endLine = innerContainingBlock.endLine;
-					innerContainingBlock.setTabSizeDirtyStatus(true,false);
-				}
-				else
-				{
-					//no need to update line offset as ColumnBlock would be rebuilt
-					ColumnBlock innerParent = (ColumnBlock)innerContainingBlock.getParent();
-					startingLine = innerContainingBlock.startLine;
-					endLine = innerContainingBlock.endLine;
-					innerParent.getChildren().remove(innerContainingBlock);
-					//startingLine =  innerParent.startLine;
-					//endLine =  innerParent.endLine;
-					//innerParent.getChildren().removeAllElements();
-					buffer.updateColumnBlocks(startingLine, endLine,(int)innerParent.columnBlockWidth , innerParent);
-				}
-					
-					
-			}
-			else
-			{
-				//this line must have been  retokenized and repainted by the BufferHandler so repaint it again here after column blocks dirty status is updated 
-				startingLine = startLine;
-				endLine = startLine;
-			}
-			handledDeletion = true;
-			rootBlock.setDirtyStatus(false);
-			if(startingLine!=-1&&endLine!=-1)
-			{	
-				
-				textArea.chunkCache.invalidateChunksFromPhys(startingLine);
-				textArea.invalidateLineRange(startingLine, endLine);
-			}
-		}
-	}//}}}
-		
-	//{{{ transactionComplete() method
-	public void transactionComplete(JEditBuffer buffer) 
-	{
-		if(!buffer.getBooleanProperty("elasticTabstops"))
-		{
-			return;
-		}
-		if((buffer.getBooleanProperty("elasticTabstops"))&&((handledInsertion==false)||(handledDeletion==false)))
-		{	
-			//if we reach here use brute force as a last resolve
-			fullyUpdateColumnBlocks(buffer);
-		}	
-			
-	}
-	//}}}
-		
-	//{{{ preContentInserted() method
-	public void preContentInserted(JEditBuffer buffer, int startLine, int offset, int numLines, int length)
-	{
-		if(!buffer.getBooleanProperty("elasticTabstops"))
-		{
-			return;
-		}
-		handledInsertion = false;
-		if(buffer.getColumnBlock()!=null)
-		buffer.getColumnBlock().setDirtyStatus(true);
-	} //}}}
-		
-	//{{{ preContentRemoved() method
-	public void preContentRemoved(JEditBuffer buffer, int startLine, int offset,
-		int numLines, int length) 
-	{
-		if(!buffer.getBooleanProperty("elasticTabstops"))
-		{
-			return;
-		}
-		handledDeletion = false;
-		singleTabDeleted = false;
-		if(buffer.getColumnBlock()!=null)
-		{	
-			buffer.getColumnBlock().setDirtyStatus(true);
-			if((numLines==0)&(length==1))
-			{
-				String str = buffer.getText(offset, length);
-				if(str.equals("\t"))
-				{
-					singleTabDeleted = true;
-				}
-			}
-		}
-	}
-	//}}}
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2010 jEdit contributors
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.textarea;
+
+import java.util.Vector;
+
+import javax.swing.text.Segment;
+
+import org.gjt.sp.jedit.buffer.BufferAdapter;
+import org.gjt.sp.jedit.buffer.JEditBuffer;
+import org.gjt.sp.jedit.textarea.TextArea;
+
+/** Buffer Listener for Elastic Tabstops.  
+  */
+public class ElasticTabStopBufferListener extends BufferAdapter
+{
+	TextArea textArea;
+	
+	private boolean handledInsertion = true;
+	private boolean handledDeletion = true;
+	private boolean singleTabDeleted = false;
+	
+	//{{{ ElasticTabStopBufferListener() method
+	public ElasticTabStopBufferListener(TextArea textArea)
+	{
+		this.textArea = textArea;
+	}//}}}
+	
+	//{{{ fullyUpdateColumnBlocks() method
+	private void fullyUpdateColumnBlocks(JEditBuffer buffer)
+	{
+		buffer.indentUsingElasticTabstops();
+		handledInsertion = true;
+		handledDeletion = true;
+		buffer.getColumnBlock().setDirtyStatus(false);
+		textArea.chunkCache.invalidateChunksFromPhys(0);
+		textArea.invalidateLineRange(0, buffer.getLineCount()-1);
+		//textArea.getPainter().repaint();
+	}//}}}
+	
+	//{{{ contentInserted() method
+	public void contentInserted(JEditBuffer buffer, int startLine, int offset,
+			int numLines, int length) 
+	{
+		if(!buffer.elasticTabstopsOn)
+		{
+			return;
+		}
+		String charDeleted;
+		boolean isASimpleChar = false;
+		boolean singleTabInserted = false;
+		if((numLines==0)&(length==1))
+		{
+			isASimpleChar = true;
+			charDeleted = buffer.getText(offset, length);
+			if(charDeleted.equals("\t"))
+			{
+				singleTabInserted  = true;
+			}
+		}
+		ColumnBlock rootBlock = buffer.getColumnBlock();
+		if(rootBlock==null)
+		{
+			return;
+		}
+		//System.out.println("BEFORE UPDATING COLUMN BLOCKS-----");
+		//System.out.println(rootBlock);
+		int indexofBlockAbove = -1;
+		ColumnBlock block = rootBlock.searchChildren(startLine);
+		ColumnBlock blockjustAbove = null;
+		boolean liesWithinBlock = false;
+		int startIndex =-1;
+		if(block!=null)
+		{	
+			startIndex =  rootBlock.getChildren().indexOf(block);
+			indexofBlockAbove=startIndex-1;
+			if(block.isLineWithinThisBlock(startLine)==0)
+			{
+				//if the line lies within this block we need to redraw it
+				startIndex++;
+				liesWithinBlock = true;
+			}
+		}
+		else
+		{
+			startIndex = rootBlock.getChildren().size();
+			indexofBlockAbove = startIndex-1;
+		}
+		
+		if(indexofBlockAbove>=0&&((ColumnBlock)(rootBlock.getChildren().get(indexofBlockAbove))).endLine+1==startLine)
+		{
+			blockjustAbove = (ColumnBlock)(rootBlock.getChildren().get(indexofBlockAbove));
+		}
+		if(numLines>0)
+		{	
+			rootBlock.endLine +=  numLines;
+			for(int i=startIndex;i<rootBlock.getChildren().size();i++)
+			{
+				((ColumnBlock)(rootBlock.getChildren().get(i))).updateLineNo(numLines);
+			}
+		}
+		int startingLine =-1;
+		int endLine = -1;
+		if(liesWithinBlock)
+		{
+			ColumnBlock innerContainingBlock = block.getContainingBlock(startLine, offset);
+			if((isASimpleChar)&&!(innerContainingBlock==null&&singleTabInserted))
+			{
+				//a simple char has been entered (no newline )
+				//if this lies inside a column block update the startIndex and endIndex of this blocks corresponding ColumnBlockLine
+				//and all subsequent ColumnBlock Lines after this one
+				//check whether columnBlockWidth is valid 
+				
+				//do nothing if this char does not lie inside a column block
+				if(innerContainingBlock!=null)
+				{
+					if(!singleTabInserted)
+					{	
+						innerContainingBlock.updateColumnBlockLineOffset(startLine, length, false);
+						startingLine = innerContainingBlock.startLine;
+						innerContainingBlock.setTabSizeDirtyStatus(true,false);
+						endLine = innerContainingBlock.endLine;
+					}
+					else
+					{
+						//no need to update line offset as ColumnBlock would be rebuilt
+						ColumnBlock innerParent = (ColumnBlock)innerContainingBlock.getParent();
+						//startingLine = innerContainingBlock.startLine;
+						//endLine = innerContainingBlock.endLine;
+						//innerParent.getChildren().remove(innerContainingBlock);
+						startingLine =  innerParent.startLine;
+						endLine =  innerParent.endLine;
+						innerParent.getChildren().removeAllElements();
+						buffer.updateColumnBlocks(startingLine, endLine,(int)innerParent.columnBlockWidth , innerParent);
+					}
+					
+				}
+				/*else if(innerContainingBlock==null&&singleTabInserted)
+				{
+					//TODO handle this case when tab has been inserted in FRONT and not OUTSIDE of a column block
+					//currently whole column block gets repainted in this case
+				}*/
+				else
+				{
+					//this line must have been  retokenized and repainted by the BufferHandler so repaint it again here after column blocks dirty status is updated 
+					startingLine = startLine;
+					endLine = startLine;
+				}
+			}
+			if((!isASimpleChar)||(innerContainingBlock==null&&singleTabInserted))
+			{	
+				startingLine = block.getStartLine();
+				endLine = block.getEndLine()+numLines;
+				rootBlock.getChildren().remove(block);
+				buffer.updateColumnBlocks(startingLine, endLine, 0, rootBlock);
+			}	
+		}
+		else
+		{
+			Segment seg  = new Segment();
+			buffer.getText(offset, length, seg);
+			if(buffer.getTabStopPosition(seg)>=0)
+			{
+				if(blockjustAbove!=null)
+				{
+					rootBlock.getChildren().remove(blockjustAbove);
+					startingLine=blockjustAbove.startLine;
+				}
+				else
+				{
+					startingLine=startLine;
+				}
+				
+				if((block!=null)&&(block.startLine==startLine+numLines+1))
+				{
+					rootBlock.getChildren().remove(block);
+					endLine = block.endLine;
+				}
+				else
+				{
+					endLine = startLine + numLines;
+				}
+				buffer.updateColumnBlocks(startingLine, endLine, 0, rootBlock);
+			}
+			
+		}
+		handledInsertion = true;
+		rootBlock.setDirtyStatus(false);
+		//System.out.println("AFTER UPDATING COLUMN BLOCKS-----");
+		//System.out.println(rootBlock);
+		if(startingLine!=-1&&endLine!=-1&&handledDeletion)
+		{	
+			textArea.chunkCache.invalidateChunksFromPhys(startingLine);
+			textArea.invalidateLineRange(startingLine, endLine);
+		}
+	}//}}}
+
+	//{{{ contentRemoved() method
+	/**
+	 * Called when text is removed from the buffer.
+	 * @param buffer The buffer in question
+	 * @param startLine The first line
+	 * @param offset The start offset, from the beginning of the buffer
+	 * @param numLines The number of lines removed
+	 * @param length The number of characters removed
+	 * @since jEdit 4.3pre3
+	 */
+	public void contentRemoved(JEditBuffer buffer, int startLine, int offset,
+		int numLines, int length)
+	{
+		if(!buffer.elasticTabstopsOn)
+		{
+			return;
+		}
+		boolean isASimpleChar = false;
+		ColumnBlock rootBlock = buffer.getColumnBlock();
+		if(rootBlock==null)
+		{
+			return;
+		}
+		if((numLines==0)&(length==1))
+		{
+			isASimpleChar = true;
+		}
+		if((!isASimpleChar))
+		{
+			//we need to remove column blocks
+			//find the column block lying just below the first line deleted
+			ColumnBlock firstBlockEffected = rootBlock.searchChildren(startLine);
+			//info we need to determine inside this if block
+			int startLineToBuild = -1;
+			int endLineToBuild = -1;
+			ColumnBlock firstBlockToBeUpdated = null;
+			ColumnBlock firstBlockToBeRemoved = null;
+			ColumnBlock lastBlockToBeRemoved = null;
+			if(firstBlockEffected!=null)
+			{
+				int indexFirstBlockEffected =rootBlock.getChildren().indexOf(firstBlockEffected);
+				ColumnBlock blockAboveFirstEffected = null;
+				boolean justBelowBlock = false;
+				if(indexFirstBlockEffected>0)
+				{
+					blockAboveFirstEffected = (ColumnBlock)rootBlock.getChildren().get(indexFirstBlockEffected-1);
+					if(blockAboveFirstEffected.endLine==startLine-1 )
+					{
+						justBelowBlock  = true;
+					}
+				}
+				int posFirstLine =  firstBlockEffected.isLineWithinThisBlock(startLine);
+				boolean firstLineLiesInside =posFirstLine==0;
+				boolean firstLineLiesAbove =posFirstLine<0;
+				int posLastLine =  firstBlockEffected.isLineWithinThisBlock(startLine+numLines);
+				boolean lastLineLiesInside =posLastLine==0;
+				boolean lastLineLiesAbove = posLastLine<0;
+				boolean lastLineLiesBelow = posLastLine>0;
+				//deletion above block
+				if(lastLineLiesAbove )
+				{
+					//if last line lies above this block cannot be connected to a block above in this deletion without touching the block above
+					/*if(justBelowBlock&&startLine+numLines+1==firstBlockEffected.startLine)
+					{
+						startLineToBuild=blockAboveFirstEffected.startLine;
+						endLineToBuild= firstBlockEffected.endLine;
+						firstBlockToBeRemoved = blockAboveFirstEffected;
+						lastBlockToBeRemoved = firstBlockEffected;
+					}*/
+					firstBlockToBeUpdated = firstBlockEffected;
+					//else
+					//{	
+						firstBlockToBeRemoved =lastBlockToBeRemoved= null;
+						startLineToBuild=endLineToBuild=-1;
+					//}	
+				}
+				//deletion inside block
+				else if((firstLineLiesInside||firstLineLiesAbove)&&lastLineLiesInside)
+				{
+					startLineToBuild = Math.min( firstBlockEffected.startLine,startLine);
+					endLineToBuild = firstBlockEffected.endLine-numLines;
+					//if(indexFirstBlockEffected<rootBlock.getChildren().size()-1)
+					//{	
+						//firstBlockToBeUpdated =(ColumnBlock)rootBlock.getChildren().get(indexFirstBlockEffected+1) ;
+					//}	
+					firstBlockToBeRemoved =lastBlockToBeRemoved= firstBlockEffected;
+					if(justBelowBlock)
+					{
+						startLineToBuild =blockAboveFirstEffected.startLine ;
+						firstBlockToBeRemoved = blockAboveFirstEffected;
+					}
+				}
+				//deletion might cover other blocks as well
+				else if(((firstLineLiesInside)||(firstLineLiesAbove))&&lastLineLiesBelow)
+				{
+					startLineToBuild = Math.min(startLine, firstBlockEffected.startLine);
+					firstBlockToBeRemoved = firstBlockEffected;
+					ColumnBlock blockBelow = rootBlock.searchChildren(startLine+numLines);
+					int indexLastBlock = rootBlock.getChildren().indexOf(blockBelow);
+					if(blockBelow!=null)
+					{
+						//deletion partially overlaps this block
+						if(blockBelow.isLineWithinThisBlock(startLine+numLines)==0)
+						{
+							if(justBelowBlock)
+							{
+								startLineToBuild =blockAboveFirstEffected.startLine ;
+								firstBlockToBeRemoved = blockAboveFirstEffected;
+							}
+							lastBlockToBeRemoved = blockBelow;
+							endLineToBuild = blockBelow.endLine-numLines;
+							//if(indexLastBlock<rootBlock.getChildren().size()-1)
+							//{
+								//firstBlockToBeUpdated = (ColumnBlock)rootBlock.getChildren().get(indexLastBlock+1);
+							//}
+						}
+						
+						//deletion lies above this block
+						else 
+						{
+							//do not need to consider blockJustAbove here as we cannot connect two column blocks without 
+							//ending on one of the lines of either
+							//firstBlockToBeUpdated = blockBelow;
+							//if we have reached here there is surely a block above this one 
+							lastBlockToBeRemoved = (ColumnBlock)rootBlock.getChildren().get(indexLastBlock-1);
+							//if the first Block is wholly covered then all column blocks are being deleted completely and there is nothing to build
+							endLineToBuild = firstLineLiesAbove?-1:startLine;
+							//consider the case where last line deleted is just above the column block block below
+							if((blockBelow.startLine==startLine+numLines+1)&&(endLineToBuild!=-1))
+							{
+								endLineToBuild = blockBelow.endLine-numLines;
+								lastBlockToBeRemoved = blockBelow;
+							}
+							if(endLineToBuild==-1)
+							{
+								startLineToBuild = -1;
+							}
+						}
+					}
+					//no block below last line
+					else
+					{
+						lastBlockToBeRemoved = (ColumnBlock)rootBlock.getChildren().get(rootBlock.getChildren().size()-1);
+						//firstBlockToBeUpdated = null;
+						if(firstLineLiesInside)
+						{	
+							endLineToBuild = startLine;
+						}
+						else
+						{
+							startLineToBuild = -1;
+							endLineToBuild= -1;
+						}
+					} 
+				}
+			}
+			//deletion lies below all column blocks
+			else
+			{
+				startLineToBuild = -1;
+				endLineToBuild = -1;
+				//firstBlockToBeUpdated = null;
+				firstBlockToBeRemoved = null;
+				lastBlockToBeRemoved = null;
+			}
+			//once we reach here we have three things to do
+			//1)delete columnBlocks using firstBlockToBeDeleted and lastBlockToBeDeleted
+			Vector<Node> blocksToBeRemoved =null;
+			if(firstBlockToBeRemoved!=null)
+			{
+				int startIndex = rootBlock.getChildren().indexOf(firstBlockToBeRemoved);
+				blocksToBeRemoved = new Vector<Node>();
+				if(lastBlockToBeRemoved == null)
+				{
+					throw new IllegalArgumentException("Deletion not handled properly");
+				}
+				int endIndex = rootBlock.getChildren().indexOf(lastBlockToBeRemoved);
+				for(int i=startIndex;i<=endIndex;i++)
+				{
+					blocksToBeRemoved.add(rootBlock.getChildren().get(i));
+				}
+
+			}	
+			//2)update startLine/endLine in column blocks using firstBlockToBeUpdated
+			if(numLines>0)
+			{	
+				rootBlock.endLine-=numLines;
+				if((lastBlockToBeRemoved!=null)||(firstBlockToBeUpdated!=null))
+				{
+					int startIndex=-1;
+					if(lastBlockToBeRemoved!=null)
+					{
+						startIndex = rootBlock.getChildren().indexOf(lastBlockToBeRemoved);
+						//start just after the last block to be removed
+						startIndex++;
+					}
+					else if(firstBlockToBeUpdated!=null)
+					{
+						startIndex = rootBlock.getChildren().indexOf(firstBlockToBeUpdated);
+					}
+					for(int i=startIndex;i<rootBlock.getChildren().size();i++)
+					{	
+						((ColumnBlock)rootBlock.getChildren().get(i)).updateLineNo(-1*numLines);
+					}	
+				}
+			}
+			//once we are done with (2) we can safely change rootBlock
+			if(blocksToBeRemoved!=null)
+			{	
+				rootBlock.getChildren().removeAll(blocksToBeRemoved);
+			}	
+			//3)rebuild column blocks using endLine and startLine
+			if(startLineToBuild!=-1&&endLineToBuild!=-1)
+			{	
+				buffer.updateColumnBlocks(startLineToBuild, endLineToBuild, 0, rootBlock);
+				rootBlock.setDirtyStatus(false);
+				textArea.chunkCache.invalidateChunksFromPhys(startLineToBuild);
+				textArea.invalidateLineRange(startLineToBuild, endLineToBuild);
+			}
+			rootBlock.setDirtyStatus(false);
+			handledDeletion = true;
+		}
+		else
+		{
+			int startingLine = -1;
+			int endLine = -1;
+			//a simple char has been entered 
+			//if this lies inside a column block update the startIndex and endIndex of this blocks corresponding ColumnBlockLine
+			//and all subsequent ColumnBlock Lines after this one
+			//check whether columnBlockWidth is valid 
+			ColumnBlock innerContainingBlock = rootBlock.getContainingBlock(startLine, offset);
+			//do nothing if this char does not lie inside a column block
+			if(innerContainingBlock!=null)
+			{
+				if(!singleTabDeleted)
+				{	
+					innerContainingBlock.updateColumnBlockLineOffset(startLine, -1*length, false);
+					startingLine = innerContainingBlock.startLine;
+					endLine = innerContainingBlock.endLine;
+					innerContainingBlock.setTabSizeDirtyStatus(true,false);
+				}
+				else
+				{
+					//no need to update line offset as ColumnBlock would be rebuilt
+					ColumnBlock innerParent = (ColumnBlock)innerContainingBlock.getParent();
+					startingLine = innerContainingBlock.startLine;
+					endLine = innerContainingBlock.endLine;
+					innerParent.getChildren().remove(innerContainingBlock);
+					//startingLine =  innerParent.startLine;
+					//endLine =  innerParent.endLine;
+					//innerParent.getChildren().removeAllElements();
+					buffer.updateColumnBlocks(startingLine, endLine,(int)innerParent.columnBlockWidth , innerParent);
+				}
+					
+					
+			}
+			else
+			{
+				//this line must have been  retokenized and repainted by the BufferHandler so repaint it again here after column blocks dirty status is updated 
+				startingLine = startLine;
+				endLine = startLine;
+			}
+			handledDeletion = true;
+			rootBlock.setDirtyStatus(false);
+			if(startingLine!=-1&&endLine!=-1)
+			{	
+				
+				textArea.chunkCache.invalidateChunksFromPhys(startingLine);
+				textArea.invalidateLineRange(startingLine, endLine);
+			}
+		}
+	}//}}}
+		
+	//{{{ transactionComplete() method
+	public void transactionComplete(JEditBuffer buffer) 
+	{
+		if(!buffer.getBooleanProperty("elasticTabstops"))
+		{
+			return;
+		}
+		if((buffer.getBooleanProperty("elasticTabstops"))&&((handledInsertion==false)||(handledDeletion==false)))
+		{	
+			//if we reach here use brute force as a last resolve
+			fullyUpdateColumnBlocks(buffer);
+		}	
+			
+	}
+	//}}}
+		
+	//{{{ preContentInserted() method
+	public void preContentInserted(JEditBuffer buffer, int startLine, int offset, int numLines, int length)
+	{
+		if(!buffer.elasticTabstopsOn)
+		{
+			return;
+		}
+		handledInsertion = false;
+		if(buffer.getColumnBlock()!=null)
+		buffer.getColumnBlock().setDirtyStatus(true);
+	} //}}}
+		
+	//{{{ preContentRemoved() method
+	public void preContentRemoved(JEditBuffer buffer, int startLine, int offset,
+		int numLines, int length) 
+	{
+		if(!buffer.elasticTabstopsOn)
+		{
+			return;
+		}
+		handledDeletion = false;
+		singleTabDeleted = false;
+		if(buffer.getColumnBlock()!=null)
+		{	
+			buffer.getColumnBlock().setDirtyStatus(true);
+			if((numLines==0)&(length==1))
+			{
+				String str = buffer.getText(offset, length);
+				if(str.equals("\t"))
+				{
+					singleTabDeleted = true;
+				}
+			}
+		}
+	}
+	//}}}
+}
diff --git a/org/gjt/sp/jedit/textarea/ElasticTabstopsTabExpander.java b/org/gjt/sp/jedit/textarea/ElasticTabstopsTabExpander.java
index e6677a4..99a41bd 100644
--- a/org/gjt/sp/jedit/textarea/ElasticTabstopsTabExpander.java
+++ b/org/gjt/sp/jedit/textarea/ElasticTabstopsTabExpander.java
@@ -1,95 +1,95 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2010 jEdit contributors
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.textarea;
-
-import java.awt.font.TextLayout;
-import java.util.Vector;
-
-import javax.swing.text.TabExpander;
-
-/** A Swing TabExpander for Elastic Tabstops. */
-
-public class ElasticTabstopsTabExpander implements TabExpander 
-{
-	TextArea textArea;
-	
-	//{{{ ElasticTabstopsTabExpander() method
-	public ElasticTabstopsTabExpander(TextArea textArea)
-	{
-		this.textArea = textArea;
-	}//}}}
-	
-	//{{{ nextTabStop() method
-	@Override
-	public float nextTabStop(float x, int tabOffset) 
-	{
-		float _tabSize = 0;
-		if(textArea.buffer.getBooleanProperty("elasticTabstops")&&textArea.buffer.getColumnBlock()!=null)
-		{
-			int line = textArea.buffer.getLineOfOffset(tabOffset);
-			_tabSize = getTabSize(textArea.buffer.getColumnBlock().getColumnBlock(line, tabOffset),line);
-			if(_tabSize<0)
-			{
-				throw new IllegalArgumentException("Unaccounted tab at line "+textArea.buffer.getLineOfOffset(tabOffset)+" at index "+tabOffset);
-			}
-		}
-		//keep minimum tab size of  textArea.tabSize
-		_tabSize+= textArea.tabSize;
-		return (x+_tabSize);
-	}//}}}
-	
-	//{{{ getTabSize() method
-	private float getTabSize(ColumnBlock columnBlock, int line) 
-	{
-		float ret = -5;
-		if(columnBlock!=null)
-		{	
-			Vector lines = columnBlock.getLines();
-			if(columnBlock.areTabSizesDirty())
-			{
-				float colBlockWidth = -1;
-				for(int i= 0;i<lines.size();i++)
-				{
-					ColumnBlockLine colBlockLine = (ColumnBlockLine)lines.elementAt(i);
-					int startOffset = colBlockLine.getColumnStartIndex()+textArea.buffer.getLineStartOffset(colBlockLine.getLine());
-					String str = textArea.buffer.getText(startOffset,colBlockLine.getColumnEndIndex()-colBlockLine.getColumnStartIndex());
-					float width = 0;
-					if(str.length()!=0)
-					{	
-						TextLayout layout = new TextLayout(str,textArea.painter.getFont(),textArea.painter.getFontRenderContext());
-						width = layout.getAdvance();
-					}
-					colBlockLine.lineLength = width;
-					//colBlockLine.lineLength = textArea.painter.getFontMetrics().stringWidth(str);
-					if((colBlockWidth<0)||(colBlockLine.lineLength>colBlockWidth))
-					{
-						colBlockWidth = colBlockLine.lineLength;
-					}
-				}
-				columnBlock.columnBlockWidth = colBlockWidth;
-				columnBlock.setTabSizeDirtyStatus(false, false);
-			}
-			ret = columnBlock.columnBlockWidth-((ColumnBlockLine)lines.get(line-columnBlock.startLine)).lineLength;
-		}	
-		return ret;
-	}//}}}
-
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2010 jEdit contributors
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.textarea;
+
+import java.awt.font.TextLayout;
+import java.util.Vector;
+
+import javax.swing.text.TabExpander;
+
+/** A Swing TabExpander for Elastic Tabstops. */
+
+public class ElasticTabstopsTabExpander implements TabExpander 
+{
+	TextArea textArea;
+	
+	//{{{ ElasticTabstopsTabExpander() method
+	public ElasticTabstopsTabExpander(TextArea textArea)
+	{
+		this.textArea = textArea;
+	}//}}}
+	
+	//{{{ nextTabStop() method
+	@Override
+	public float nextTabStop(float x, int tabOffset) 
+	{
+		float _tabSize = 0;
+		if(textArea.buffer.getBooleanProperty("elasticTabstops")&&textArea.buffer.getColumnBlock()!=null)
+		{
+			int line = textArea.buffer.getLineOfOffset(tabOffset);
+			_tabSize = getTabSize(textArea.buffer.getColumnBlock().getColumnBlock(line, tabOffset),line);
+			if(_tabSize<0)
+			{
+				throw new IllegalArgumentException("Unaccounted tab at line "+textArea.buffer.getLineOfOffset(tabOffset)+" at index "+tabOffset);
+			}
+		}
+		//keep minimum tab size of  textArea.tabSize
+		_tabSize+= textArea.tabSize;
+		return (x+_tabSize);
+	}//}}}
+	
+	//{{{ getTabSize() method
+	private float getTabSize(ColumnBlock columnBlock, int line) 
+	{
+		float ret = -5;
+		if(columnBlock!=null)
+		{	
+			Vector<ColumnBlockLine> lines = columnBlock.getLines();
+			if(columnBlock.areTabSizesDirty())
+			{
+				float colBlockWidth = -1;
+				for(int i= 0;i<lines.size();i++)
+				{
+					ColumnBlockLine colBlockLine = (ColumnBlockLine)lines.elementAt(i);
+					int startOffset = colBlockLine.getColumnStartIndex()+textArea.buffer.getLineStartOffset(colBlockLine.getLine());
+					String str = textArea.buffer.getText(startOffset,colBlockLine.getColumnEndIndex()-colBlockLine.getColumnStartIndex());
+					float width = 0;
+					if(str.length()!=0)
+					{	
+						TextLayout layout = new TextLayout(str,textArea.painter.getFont(),textArea.painter.getFontRenderContext());
+						width = layout.getAdvance();
+					}
+					colBlockLine.lineLength = width;
+					//colBlockLine.lineLength = textArea.painter.getFontMetrics().stringWidth(str);
+					if((colBlockWidth<0)||(colBlockLine.lineLength>colBlockWidth))
+					{
+						colBlockWidth = colBlockLine.lineLength;
+					}
+				}
+				columnBlock.columnBlockWidth = colBlockWidth;
+				columnBlock.setTabSizeDirtyStatus(false, false);
+			}
+			ret = columnBlock.columnBlockWidth-((ColumnBlockLine)lines.get(line-columnBlock.startLine)).lineLength;
+		}	
+		return ret;
+	}//}}}
+
+}
diff --git a/org/gjt/sp/jedit/textarea/ExtensionManager.java b/org/gjt/sp/jedit/textarea/ExtensionManager.java
index a3d7b8f..68ba523 100644
--- a/org/gjt/sp/jedit/textarea/ExtensionManager.java
+++ b/org/gjt/sp/jedit/textarea/ExtensionManager.java
@@ -1,6 +1,6 @@
 /*
  * ExtensionManager.java -
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002, 2003 Slava Pestov
@@ -30,7 +30,7 @@ import org.gjt.sp.util.Log;
  * Manage the extensions for the gutter and the textarea.
  *
  * @author Slava Pestov
- * @version $Id: ExtensionManager.java 16346 2009-10-14 10:35:10Z kpouer $
+ * @version $Id: ExtensionManager.java 21831 2012-06-18 22:54:17Z ezust $
  */
 class ExtensionManager
 {
diff --git a/org/gjt/sp/jedit/textarea/FirstLine.java b/org/gjt/sp/jedit/textarea/FirstLine.java
index 1247104..816282f 100644
--- a/org/gjt/sp/jedit/textarea/FirstLine.java
+++ b/org/gjt/sp/jedit/textarea/FirstLine.java
@@ -1,6 +1,6 @@
 /*
  * FirstLine.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
@@ -29,7 +29,7 @@ import org.gjt.sp.util.Log;
  * This Anchor is the first visible line of the textarea.
  *
  * @author Slava Pestov
- * @version $Id: FirstLine.java 22366 2012-10-13 22:21:34Z ezust $
+ * @version $Id: FirstLine.java 22670 2013-01-12 12:29:48Z thomasmey $
  */
 class FirstLine extends Anchor
 {
@@ -528,7 +528,6 @@ class FirstLine extends Anchor
 		if(this.skew != skew)
 		{
 			this.skew = skew;
-			//FIXME: Necessary?
 			setCallChanged(true);
 		}
 	}
diff --git a/org/gjt/sp/jedit/textarea/FoldPainter.java b/org/gjt/sp/jedit/textarea/FoldPainter.java
index 0348ccb..4b590ea 100644
--- a/org/gjt/sp/jedit/textarea/FoldPainter.java
+++ b/org/gjt/sp/jedit/textarea/FoldPainter.java
@@ -1,78 +1,78 @@
-/*
- * FoldPainter.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2008 Shlomy Reinstein
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.textarea;
-
-import java.awt.Graphics2D;
-
-import org.gjt.sp.jedit.buffer.JEditBuffer;
-
-/**
- * FoldPainter defines the interface for fold painters in the gutter.
- *
- * @since jEdit 4.3pre16
- * @author Shlomy Reinstein
- * @version $Id: FoldPainter.java 18569 2010-09-16 08:35:11Z kpouer $
- */
-public interface FoldPainter
-{
-	/**
-	 * Paints the beginning of a fold in the gutter.
-	 * @param gutter The gutter in which the fold is drawn.
-	 * @param gfx The graphics object to use for the painting.
-	 * @param screenLine The index of the line on the screen (e.g. 5th from top).
-	 * @param physicalLine The index of the line in the buffer.
-	 * @param nextLineVisible Whether the next buffer line is visible on screen.
-	 * @param y The y coordinate of the top of the line on the screen.
-	 * @param lineHeight The line height in pixels.
-	 * @param buffer The buffer to which the line belongs.
-	 */
-	void paintFoldStart(Gutter gutter, Graphics2D gfx, int screenLine,
-		int physicalLine, boolean nextLineVisible, int y, int lineHeight,
-		JEditBuffer buffer);
-	
-	/**
-	 * Paints the end of a fold in the gutter.
-	 * @param gutter The gutter in which the fold is drawn.
-	 * @param gfx The graphics object to use for the painting.
-	 * @param screenLine The index of the line on the screen (e.g. 5th from top).
-	 * @param physicalLine The index of the line in the buffer.
-	 * @param y The y coordinate of the top of the line on the screen.
-	 * @param lineHeight The line height in pixels.
-	 * @param buffer The buffer to which the line belongs.
-	 */
-	void paintFoldEnd(Gutter gutter, Graphics2D gfx, int screenLine,
-		int physicalLine, int y, int lineHeight, JEditBuffer buffer);
-	
-	/**
-	 * Paints the middle of a fold (single line) in the gutter.
-	 * @param gutter The gutter in which the fold is drawn.
-	 * @param gfx The graphics object to use for the painting.
-	 * @param screenLine The index of the line on the screen (e.g. 5th from top).
-	 * @param physicalLine The index of the line in the buffer.
-	 * @param y The y coordinate of the top of the line on the screen.
-	 * @param lineHeight The line height in pixels.
-	 * @param buffer The buffer to which the line belongs.
-	 */
-	void paintFoldMiddle(Gutter gutter, Graphics2D gfx, int screenLine,
-		int physicalLine, int y, int lineHeight, JEditBuffer buffer);
-}
+/*
+ * FoldPainter.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2008 Shlomy Reinstein
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.textarea;
+
+import java.awt.Graphics2D;
+
+import org.gjt.sp.jedit.buffer.JEditBuffer;
+
+/**
+ * FoldPainter defines the interface for fold painters in the gutter.
+ *
+ * @since jEdit 4.3pre16
+ * @author Shlomy Reinstein
+ * @version $Id: FoldPainter.java 21971 2012-08-02 20:32:37Z jarekczek $
+ */
+public interface FoldPainter
+{
+	/**
+	 * Paints the beginning of a fold in the gutter.
+	 * @param gutter The gutter in which the fold is drawn.
+	 * @param gfx The graphics object to use for the painting.
+	 * @param screenLine The index of the line on the screen (e.g. 5th from top).
+	 * @param physicalLine The index of the line in the buffer.
+	 * @param nextLineVisible Whether the next buffer line is visible on screen.
+	 * @param y The y coordinate of the top of the line on the screen.
+	 * @param lineHeight The line height in pixels.
+	 * @param buffer The buffer to which the line belongs.
+	 */
+	void paintFoldStart(Gutter gutter, Graphics2D gfx, int screenLine,
+		int physicalLine, boolean nextLineVisible, int y, int lineHeight,
+		JEditBuffer buffer);
+	
+	/**
+	 * Paints the end of a fold in the gutter.
+	 * @param gutter The gutter in which the fold is drawn.
+	 * @param gfx The graphics object to use for the painting.
+	 * @param screenLine The index of the line on the screen (e.g. 5th from top).
+	 * @param physicalLine The index of the line in the buffer.
+	 * @param y The y coordinate of the top of the line on the screen.
+	 * @param lineHeight The line height in pixels.
+	 * @param buffer The buffer to which the line belongs.
+	 */
+	void paintFoldEnd(Gutter gutter, Graphics2D gfx, int screenLine,
+		int physicalLine, int y, int lineHeight, JEditBuffer buffer);
+	
+	/**
+	 * Paints the middle of a fold (single line) in the gutter.
+	 * @param gutter The gutter in which the fold is drawn.
+	 * @param gfx The graphics object to use for the painting.
+	 * @param screenLine The index of the line on the screen (e.g. 5th from top).
+	 * @param physicalLine The index of the line in the buffer.
+	 * @param y The y coordinate of the top of the line on the screen.
+	 * @param lineHeight The line height in pixels.
+	 * @param buffer The buffer to which the line belongs.
+	 */
+	void paintFoldMiddle(Gutter gutter, Graphics2D gfx, int screenLine,
+		int physicalLine, int y, int lineHeight, JEditBuffer buffer);
+}
diff --git a/org/gjt/sp/jedit/textarea/Gutter.java b/org/gjt/sp/jedit/textarea/Gutter.java
index f45ce55..2d831dd 100644
--- a/org/gjt/sp/jedit/textarea/Gutter.java
+++ b/org/gjt/sp/jedit/textarea/Gutter.java
@@ -1,6 +1,6 @@
 /*
  * Gutter.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2000 mike dillon
@@ -50,7 +50,7 @@ import org.gjt.sp.util.Log;
  * @see TextArea
  *
  * @author Mike Dillon and Slava Pestov
- * @version $Id: Gutter.java 21683 2012-05-19 09:33:20Z jarekczek $
+ * @version $Id: Gutter.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class Gutter extends JComponent implements SwingConstants
 {
diff --git a/org/gjt/sp/jedit/textarea/GutterPopupHandler.java b/org/gjt/sp/jedit/textarea/GutterPopupHandler.java
index 65fd6aa..e4cf9f8 100644
--- a/org/gjt/sp/jedit/textarea/GutterPopupHandler.java
+++ b/org/gjt/sp/jedit/textarea/GutterPopupHandler.java
@@ -1,26 +1,26 @@
-/*
- * GutterPopupHandler.java - Handles popup trigger in the gutter
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2009 Shlomy Reinstein
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.textarea;
-
-public interface GutterPopupHandler {
-	void handlePopup(int x, int y, int line);
-}
+/*
+ * GutterPopupHandler.java - Handles popup trigger in the gutter
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2009 Shlomy Reinstein
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.textarea;
+
+public interface GutterPopupHandler {
+	void handlePopup(int x, int y, int line);
+}
diff --git a/org/gjt/sp/jedit/textarea/InputMethodSupport.java b/org/gjt/sp/jedit/textarea/InputMethodSupport.java
index 80ac620..fc738dd 100644
--- a/org/gjt/sp/jedit/textarea/InputMethodSupport.java
+++ b/org/gjt/sp/jedit/textarea/InputMethodSupport.java
@@ -1,7 +1,7 @@
 /*
  * InputMethodSupport.java - Input method support for JEditTextArea
  *
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Kazutoshi Satoda
diff --git a/org/gjt/sp/jedit/textarea/JEditEmbeddedTextArea.java b/org/gjt/sp/jedit/textarea/JEditEmbeddedTextArea.java
index d6fc44a..4522d91 100644
--- a/org/gjt/sp/jedit/textarea/JEditEmbeddedTextArea.java
+++ b/org/gjt/sp/jedit/textarea/JEditEmbeddedTextArea.java
@@ -1,6 +1,6 @@
 /*
  * JEditEmbeddedTextArea.java - A TextArea that can be embedded in applications
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/textarea/JEditTextArea.java b/org/gjt/sp/jedit/textarea/JEditTextArea.java
index f20e548..a844d30 100644
--- a/org/gjt/sp/jedit/textarea/JEditTextArea.java
+++ b/org/gjt/sp/jedit/textarea/JEditTextArea.java
@@ -1,6 +1,6 @@
 /*
  * JEditTextArea.java - jEdit's text component
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2005 Slava Pestov
@@ -49,7 +49,7 @@ import org.gjt.sp.jedit.msg.PositionChanging;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: JEditTextArea.java 21772 2012-06-08 19:43:00Z jarekczek $
+ * @version $Id: JEditTextArea.java 22469 2012-11-14 08:05:15Z ezust $
  */
 public class JEditTextArea extends TextArea
 {
@@ -256,13 +256,16 @@ public class JEditTextArea extends TextArea
 	 */
 	public void showGoToLineDialog()
 	{
-		String line = GUIUtilities.input(view,"goto-line",null);
+		int maxLine = Integer.valueOf(buffer.getLineCount());
+		String line = GUIUtilities.input(view,"goto-line",new Integer[] {1, maxLine},null);
 		if(line == null)
 			return;
 
 		try
 		{
 			int lineNumber = Integer.parseInt(line) - 1;
+			if(lineNumber > --maxLine)
+				lineNumber = maxLine;
 			EditBus.send(new PositionChanging(this));
 			setCaretPosition(getLineStartOffset(lineNumber));
 		}
diff --git a/org/gjt/sp/jedit/textarea/MouseActions.java b/org/gjt/sp/jedit/textarea/MouseActions.java
index 0e634a8..6c8e796 100644
--- a/org/gjt/sp/jedit/textarea/MouseActions.java
+++ b/org/gjt/sp/jedit/textarea/MouseActions.java
@@ -1,6 +1,6 @@
 /*
  * MouseActions.java - Simplifies mouse handling
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
diff --git a/org/gjt/sp/jedit/textarea/MouseActionsProvider.java b/org/gjt/sp/jedit/textarea/MouseActionsProvider.java
index 6787190..4cd09f1 100644
--- a/org/gjt/sp/jedit/textarea/MouseActionsProvider.java
+++ b/org/gjt/sp/jedit/textarea/MouseActionsProvider.java
@@ -1,6 +1,6 @@
 /*
  * MouseActionsProvider.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
@@ -25,7 +25,7 @@ import java.awt.event.MouseEvent;
 
 /**
  * @author Matthieu Casanova
- * @version $Id: MouseActionsProvider.java 15577 2009-06-25 05:55:16Z ezust $
+ * @version $Id: MouseActionsProvider.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public interface MouseActionsProvider
 {
diff --git a/org/gjt/sp/jedit/textarea/MouseHandler.java b/org/gjt/sp/jedit/textarea/MouseHandler.java
index 63755b0..36966c5 100644
--- a/org/gjt/sp/jedit/textarea/MouseHandler.java
+++ b/org/gjt/sp/jedit/textarea/MouseHandler.java
@@ -1,6 +1,6 @@
 /*
  * MouseHandler.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2005 Slava Pestov
@@ -50,6 +50,13 @@ public class MouseHandler extends TextAreaMouseHandler
 	{
 		showCursor();
 
+		if (evt.getButton() == MouseEvent.NOBUTTON)
+		{
+			// Suppress presses with no button, to avoid
+			// problems due to horizontal scrolling.
+			return;
+		}
+
 		control = (OperatingSystem.isMacOS() && evt.isMetaDown())
 			|| (!OperatingSystem.isMacOS() && evt.isControlDown());
 
@@ -134,6 +141,13 @@ public class MouseHandler extends TextAreaMouseHandler
 	@Override
 	public void mouseReleased(MouseEvent evt)
 	{
+		if (evt.getButton() == MouseEvent.NOBUTTON)
+		{
+			// Suppress releases with no button, to avoid
+			// problems due to horizontal scrolling.
+			return;
+		}
+
 		// middle mouse button drag inserts selection
 		// at caret position
 		Selection sel = textArea.getSelectionAtOffset(dragStart);
diff --git a/org/gjt/sp/jedit/textarea/Node.java b/org/gjt/sp/jedit/textarea/Node.java
index 3a89a7e..ce73f26 100644
--- a/org/gjt/sp/jedit/textarea/Node.java
+++ b/org/gjt/sp/jedit/textarea/Node.java
@@ -1,31 +1,31 @@
-/*
- * ColumnBlock.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 Anshal Shukla
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.textarea;
-
-import java.util.Vector;
-
-public interface Node 
-{
-	void addChild(Node node);
-	Vector  getChildren();
-	Node getParent();
-}
+/*
+ * ColumnBlock.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010 Anshal Shukla
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.jedit.textarea;
+
+import java.util.Vector;
+
+public interface Node 
+{
+	void addChild(Node node);
+	Vector  getChildren();
+	Node getParent();
+}
diff --git a/org/gjt/sp/jedit/textarea/RangeMap.java b/org/gjt/sp/jedit/textarea/RangeMap.java
index 8943820..75aa3a1 100644
--- a/org/gjt/sp/jedit/textarea/RangeMap.java
+++ b/org/gjt/sp/jedit/textarea/RangeMap.java
@@ -1,6 +1,6 @@
 /*
  * RangeMap.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2005 Slava Pestov
diff --git a/org/gjt/sp/jedit/textarea/ScreenLineManager.java b/org/gjt/sp/jedit/textarea/ScreenLineManager.java
index 5428e22..2bad148 100644
--- a/org/gjt/sp/jedit/textarea/ScreenLineManager.java
+++ b/org/gjt/sp/jedit/textarea/ScreenLineManager.java
@@ -1,6 +1,6 @@
 /*
  * ScreenLineManager.java - Manage screen line counts
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2004 Slava Pestov
@@ -33,7 +33,7 @@ import org.gjt.sp.util.Log;
  * 
  * @since jEdit 4.3pre1
  * @author Slava Pestov
- * @version $Id: ScreenLineManager.java 22366 2012-10-13 22:21:34Z ezust $
+ * @version $Id: ScreenLineManager.java 22629 2012-12-29 17:06:56Z thomasmey $
  */
 class ScreenLineManager
 {
@@ -48,7 +48,7 @@ class ScreenLineManager
 	//{{{ isScreenLineCountValid() method
 	boolean isScreenLineCountValid(int line)
 	{
-		return (screenLines[line] & SCREEN_LINES_VALID_MASK) != 0;
+		return screenLines[line] > 0;
 	} //}}}
 
 	//{{{ getScreenLineCount() method
@@ -62,14 +62,14 @@ class ScreenLineManager
 	int getScreenLineCount(int line)
 	{
 		assert isScreenLineCountValid(line);
-		return screenLines[line] >> SCREEN_LINES_SHIFT;
+		return screenLines[line];
 	} //}}}
 
 	//{{{ setScreenLineCount() method
 	/**
 	 * Sets the number of screen lines that the specified physical line
 	 * is split into.
-	 * @param line the line number
+	 * @param line the physical line number
 	 * @param count the line count (1 if no wrap)
 	 */
 	void setScreenLineCount(int line, int count)
@@ -80,31 +80,38 @@ class ScreenLineManager
 		{
 			// limitations...
 			count = Short.MAX_VALUE;
+			Log.log(Log.ERROR,this,new Exception("Max screen line count hit!"));
 		}
 
 		if(Debug.SCREEN_LINES_DEBUG)
 			Log.log(Log.DEBUG,this,new Exception("setScreenLineCount(" + line + ',' + count + ')'));
-		screenLines[line] = (short)(count << SCREEN_LINES_SHIFT | SCREEN_LINES_VALID_MASK);
+		screenLines[line] = (char)count;
 	} //}}}
 
 	//{{{ invalidateScreenLineCounts() method
 	void invalidateScreenLineCounts()
 	{
 		for(int i = 0, lineCount = buffer.getLineCount(); i < lineCount; i++)
-			screenLines[i] &= ~SCREEN_LINES_VALID_MASK;
+			invalidateScreenLineCount(i);
+	} //}}}
+
+	//{{{ invalidateScreenLineCounts() method
+	private void invalidateScreenLineCount(int physicalLineNo)
+	{
+		screenLines[physicalLineNo] = 0;
 	} //}}}
 
 	//{{{ reset() method
 	void reset()
 	{
-		screenLines = new short[buffer.getLineCount()];
+		screenLines = new char[buffer.getLineCount()];
 	} //}}}
 
 	//{{{ contentInserted() method
 	public void contentInserted(int startLine, int numLines)
 	{
 		int endLine = startLine + numLines;
-		screenLines[startLine] &= ~SCREEN_LINES_VALID_MASK;
+		invalidateScreenLineCount(startLine);
 
 		int lineCount = buffer.getLineCount();
 
@@ -112,7 +119,7 @@ class ScreenLineManager
 		{
 			if(screenLines.length <= lineCount)
 			{
-				short[] screenLinesN = new short[((lineCount + 1) << 1)];
+				char[] screenLinesN = new char[((lineCount + 1) << 1)];
 				System.arraycopy(screenLines,0,screenLinesN,0,
 						 screenLines.length);
 				screenLines = screenLinesN;
@@ -130,7 +137,7 @@ class ScreenLineManager
 	public void contentRemoved(int startLine, int numLines)
 	{
 		int endLine = startLine + numLines;
-		screenLines[startLine] &= ~SCREEN_LINES_VALID_MASK;
+		invalidateScreenLineCount(startLine);
 
 		if(numLines > 0 && endLine != screenLines.length)
 		{
@@ -140,12 +147,12 @@ class ScreenLineManager
 	} //}}}
 
 	//{{{ Private members
-	private static final int SCREEN_LINES_SHIFT = 1;
-	private static final int SCREEN_LINES_VALID_MASK = 1;
-
 	private final JEditBuffer buffer;
 
-	/** This array contains the screen line count for each physical line. */
-	private short[] screenLines;
+	/** This array contains the screen line count for each physical line.
+	 * screenLines[physicalLineNo] == 0 -> invalid entry - No. of screen lines not calculated yet
+	 * screenLines[physicalLineNo] > 0 -> valid entry - No. of screen lines already calculated 
+	 */
+	private char[] screenLines;
 	//}}}
 }
diff --git a/org/gjt/sp/jedit/textarea/ScrollLayout.java b/org/gjt/sp/jedit/textarea/ScrollLayout.java
index 037b639..d79c47d 100644
--- a/org/gjt/sp/jedit/textarea/ScrollLayout.java
+++ b/org/gjt/sp/jedit/textarea/ScrollLayout.java
@@ -1,6 +1,6 @@
 /*
  * ScrollLayout.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2004 Slava Pestov
diff --git a/org/gjt/sp/jedit/textarea/ScrollLineCount.java b/org/gjt/sp/jedit/textarea/ScrollLineCount.java
index 8fb7fbf..f322de3 100644
--- a/org/gjt/sp/jedit/textarea/ScrollLineCount.java
+++ b/org/gjt/sp/jedit/textarea/ScrollLineCount.java
@@ -1,6 +1,6 @@
 /*
  * ScrollLineCount.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
@@ -102,7 +102,7 @@ class ScrollLineCount extends Anchor
 		int scrollLines = 0;
 		int physicalLine = startLine;
 		int numLinesVisible = 0;
-		
+
 		for(int i = 0, n = numLines; i < n; i++, physicalLine++)
 		{
 			if(getDisplayManager().isLineVisible(physicalLine))
diff --git a/org/gjt/sp/jedit/textarea/Selection.java b/org/gjt/sp/jedit/textarea/Selection.java
index c3cdd86..5ec18b6 100644
--- a/org/gjt/sp/jedit/textarea/Selection.java
+++ b/org/gjt/sp/jedit/textarea/Selection.java
@@ -1,6 +1,6 @@
 /*
  * Selection.java - Selected text
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001, 2005 Slava Pestov
@@ -42,7 +42,7 @@ import org.gjt.sp.util.StandardUtilities;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: Selection.java 21723 2012-05-27 14:34:13Z k_satoda $
+ * @version $Id: Selection.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 3.2pre1
  */
 public abstract class Selection implements Cloneable
diff --git a/org/gjt/sp/jedit/textarea/SelectionManager.java b/org/gjt/sp/jedit/textarea/SelectionManager.java
index fd0bd8c..c1f1320 100644
--- a/org/gjt/sp/jedit/textarea/SelectionManager.java
+++ b/org/gjt/sp/jedit/textarea/SelectionManager.java
@@ -1,6 +1,6 @@
 /*
  * SelectionManager.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2004 Slava Pestov
@@ -28,6 +28,8 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
+import javax.annotation.Nonnull;
+
 import org.gjt.sp.jedit.buffer.*;
 //}}}
 
@@ -59,6 +61,7 @@ class SelectionManager
 	 * Returns the current selection.
 	 * @since jEdit 3.2pre1
 	 */
+	@Nonnull
 	public Selection[] getSelection()
 	{
 		return selection.toArray(
diff --git a/org/gjt/sp/jedit/textarea/ShapedFoldPainter.java b/org/gjt/sp/jedit/textarea/ShapedFoldPainter.java
index 4f7ce68..5ed1baa 100644
--- a/org/gjt/sp/jedit/textarea/ShapedFoldPainter.java
+++ b/org/gjt/sp/jedit/textarea/ShapedFoldPainter.java
@@ -1,83 +1,83 @@
-/*
- * ShapedFoldPainter.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=0:
- *
- * Copyright (C) 2008 Shlomy Reinstein
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.textarea;
-
-import java.awt.Graphics2D;
-
-import org.gjt.sp.jedit.buffer.JEditBuffer;
-
-// {{{ ShapedFoldPainter class
-/**
- * Fold Painter
- */
-public abstract class ShapedFoldPainter implements FoldPainter 
-{
-	// {{{ paintFoldEnd()
-	public void paintFoldEnd(Gutter gutter, Graphics2D gfx, int screenLine,
-			int physicalLine, int y, int lineHeight, JEditBuffer buffer)
-	{
-		gfx.setColor(gutter.getFoldColor());
-		int _y = y + lineHeight / 2;
-		int _x = 5;
-		gfx.drawLine(_x,y,_x,_y+3);
-		gfx.drawLine(_x,_y+3,_x+4,_y+3);
-		boolean nested = (physicalLine < buffer.getLineCount() - 1 &&
-			buffer.getFoldLevel(physicalLine + 1) > 0);
-		if (nested)
-			gfx.drawLine(_x,y+4,_x,y+lineHeight-1);
-	}// }}}
-
-	// {{{ paintFoldMiddle()
-	public void paintFoldMiddle(Gutter gutter, Graphics2D gfx, int screenLine,
-			int physicalLine, int y, int lineHeight, JEditBuffer buffer)
-	{
-		gfx.setColor(gutter.getFoldColor());
-		gfx.drawLine(5,y,5,y+lineHeight-1);
-	}// }}}
-
-	// {{{ paintFoldStart()
-	public void paintFoldStart(Gutter gutter, Graphics2D gfx, int screenLine,
-			int physicalLine, boolean nextLineVisible, int y, int lineHeight,
-			JEditBuffer buffer)
-	{
-		int _y = y + lineHeight / 2;
-		int _x = 5;
-		gfx.setColor(gutter.getFoldColor());
-		paintFoldShape(gfx, _y - 4, _y + 4);
-		gfx.drawLine(_x-2,_y,_x+2,_y);
-		boolean nested = (buffer.getFoldLevel(physicalLine) > 0);
-		if (nested)
-			gfx.drawLine(_x,y,_x,_y-5);
-		if (nextLineVisible)
-			gfx.drawLine(_x,_y+5,_x,y+lineHeight-1);
-		else
-		{
-			gfx.drawLine(_x,_y-2,_x,_y+2);
-			if (nested)
-				gfx.drawLine(_x,_y+4,_x,y+lineHeight-1);
-		}
-	}// }}}
-
-	protected abstract void paintFoldShape(Graphics2D gfx, int top, int bottom);
-
-} // }}}
+/*
+ * ShapedFoldPainter.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=0:
+ *
+ * Copyright (C) 2008 Shlomy Reinstein
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.textarea;
+
+import java.awt.Graphics2D;
+
+import org.gjt.sp.jedit.buffer.JEditBuffer;
+
+// {{{ ShapedFoldPainter class
+/**
+ * Fold Painter
+ */
+public abstract class ShapedFoldPainter implements FoldPainter 
+{
+	// {{{ paintFoldEnd()
+	public void paintFoldEnd(Gutter gutter, Graphics2D gfx, int screenLine,
+			int physicalLine, int y, int lineHeight, JEditBuffer buffer)
+	{
+		gfx.setColor(gutter.getFoldColor());
+		int _y = y + lineHeight / 2;
+		int _x = 5;
+		gfx.drawLine(_x,y,_x,_y+3);
+		gfx.drawLine(_x,_y+3,_x+4,_y+3);
+		boolean nested = (physicalLine < buffer.getLineCount() - 1 &&
+			buffer.getFoldLevel(physicalLine + 1) > 0);
+		if (nested)
+			gfx.drawLine(_x,y+4,_x,y+lineHeight-1);
+	}// }}}
+
+	// {{{ paintFoldMiddle()
+	public void paintFoldMiddle(Gutter gutter, Graphics2D gfx, int screenLine,
+			int physicalLine, int y, int lineHeight, JEditBuffer buffer)
+	{
+		gfx.setColor(gutter.getFoldColor());
+		gfx.drawLine(5,y,5,y+lineHeight-1);
+	}// }}}
+
+	// {{{ paintFoldStart()
+	public void paintFoldStart(Gutter gutter, Graphics2D gfx, int screenLine,
+			int physicalLine, boolean nextLineVisible, int y, int lineHeight,
+			JEditBuffer buffer)
+	{
+		int _y = y + lineHeight / 2;
+		int _x = 5;
+		gfx.setColor(gutter.getFoldColor());
+		paintFoldShape(gfx, _y - 4, _y + 4);
+		gfx.drawLine(_x-2,_y,_x+2,_y);
+		boolean nested = (buffer.getFoldLevel(physicalLine) > 0);
+		if (nested)
+			gfx.drawLine(_x,y,_x,_y-5);
+		if (nextLineVisible)
+			gfx.drawLine(_x,_y+5,_x,y+lineHeight-1);
+		else
+		{
+			gfx.drawLine(_x,_y-2,_x,_y+2);
+			if (nested)
+				gfx.drawLine(_x,_y+4,_x,y+lineHeight-1);
+		}
+	}// }}}
+
+	protected abstract void paintFoldShape(Graphics2D gfx, int top, int bottom);
+
+} // }}}
diff --git a/org/gjt/sp/jedit/textarea/SquareFoldPainter.java b/org/gjt/sp/jedit/textarea/SquareFoldPainter.java
index 35f2895..8da17ad 100644
--- a/org/gjt/sp/jedit/textarea/SquareFoldPainter.java
+++ b/org/gjt/sp/jedit/textarea/SquareFoldPainter.java
@@ -1,36 +1,36 @@
-/*
- * SquareFoldPainter.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=0:
- *
- * Copyright (C) 2008 Shlomy Reinstein
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.textarea;
-
-import java.awt.Graphics2D;
-
-// {{{ SquareFoldPainter
-public class SquareFoldPainter extends ShapedFoldPainter
-{
-	@Override
-	protected void paintFoldShape(Graphics2D gfx, int top, int bottom)
-	{
-		gfx.drawRect(1,top,8,(bottom-top));
-	}
-
-} // }}}
+/*
+ * SquareFoldPainter.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=0:
+ *
+ * Copyright (C) 2008 Shlomy Reinstein
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.textarea;
+
+import java.awt.Graphics2D;
+
+// {{{ SquareFoldPainter
+public class SquareFoldPainter extends ShapedFoldPainter
+{
+	@Override
+	protected void paintFoldShape(Graphics2D gfx, int top, int bottom)
+	{
+		gfx.drawRect(1,top,8,(bottom-top));
+	}
+
+} // }}}
diff --git a/org/gjt/sp/jedit/textarea/StandaloneTextArea.java b/org/gjt/sp/jedit/textarea/StandaloneTextArea.java
index c0afeaf..9a0f8bf 100644
--- a/org/gjt/sp/jedit/textarea/StandaloneTextArea.java
+++ b/org/gjt/sp/jedit/textarea/StandaloneTextArea.java
@@ -1,6 +1,6 @@
 /*
  * StandaloneTextArea.java - A TextArea that can be embedded in applications
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2005 Slava Pestov
@@ -27,7 +27,7 @@ package org.gjt.sp.jedit.textarea;
 //{{{ Imports
 import java.awt.Color;
 import java.awt.Font;
-import java.awt.event.ActionEvent;
+import java.io.Closeable;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -35,9 +35,7 @@ import java.io.InputStream;
 import java.net.URL;
 import java.util.Properties;
 
-import javax.swing.AbstractAction;
 import javax.swing.JFrame;
-import javax.swing.JMenuItem;
 import javax.swing.WindowConstants;
 
 import org.gjt.sp.jedit.IPropertyManager;
@@ -63,7 +61,6 @@ import org.gjt.sp.jedit.syntax.TokenMarker;
 import org.gjt.sp.util.IOUtilities;
 import org.gjt.sp.util.Log;
 import org.gjt.sp.util.SyntaxUtilities;
-
 //}}}
 
 /** jEdit's standalone text component.
@@ -100,7 +97,7 @@ import org.gjt.sp.util.SyntaxUtilities;
  * @author Slava Pestov
  * @author John Gellene (API documentation)
    @author Matthieu Casanova
- * @version $Id: StandaloneTextArea.java 22132 2012-09-02 02:03:27Z ezust $
+ * @version $Id: StandaloneTextArea.java 22357 2012-10-13 04:58:01Z ezust $
  */
 public class StandaloneTextArea extends TextArea
 {
@@ -529,28 +526,6 @@ public class StandaloneTextArea extends TextArea
 		buffer.propertiesChanged();
 	} // }}}
 
-	//{{{ addMenuItem() method
-	/**
-	 * Adds a menu item from the action context to the popup menu and returns the item.
-	 * @return the menu item added
-	 */
-	public JMenuItem addMenuItem(String action, String label)
-	{
-		final JEditBeanShellAction shellAction = getActionContext().getAction(action);
-		if (shellAction == null)
-			return null ;
-		JMenuItem item = new JMenuItem();
-		item.setAction(new AbstractAction(label)
-		{
-			public void actionPerformed(ActionEvent e)
-			{
-				shellAction.invoke(StandaloneTextArea.this);
-			}
-		});
-		popup.add(item);
-		return item;
-	} //}}}
-
 	//{{{ createTextArea() method
 	/**
 	 * Create a standalone TextArea.
@@ -604,7 +579,7 @@ public class StandaloneTextArea extends TextArea
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(in);
+			IOUtilities.closeQuietly((Closeable)in);
 		}
 		return props;
 	} //}}}
diff --git a/org/gjt/sp/jedit/textarea/StructureMatcher.java b/org/gjt/sp/jedit/textarea/StructureMatcher.java
index 69c1a2c..a618ae9 100644
--- a/org/gjt/sp/jedit/textarea/StructureMatcher.java
+++ b/org/gjt/sp/jedit/textarea/StructureMatcher.java
@@ -1,6 +1,6 @@
 /*
  * StructureMatcher.java - Abstract interface for bracket matching, etc.
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2003 Slava Pestov
@@ -33,7 +33,7 @@ import org.gjt.sp.jedit.TextUtilities;
  * for matching XML tags.
  *
  * @author Slava Pestov
- * @version $Id: StructureMatcher.java 18808 2010-10-21 20:54:15Z daleanson $
+ * @version $Id: StructureMatcher.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.2pre3
  */
 public interface StructureMatcher
diff --git a/org/gjt/sp/jedit/textarea/TextArea.java b/org/gjt/sp/jedit/textarea/TextArea.java
index 23a2309..61d70f6 100644
--- a/org/gjt/sp/jedit/textarea/TextArea.java
+++ b/org/gjt/sp/jedit/textarea/TextArea.java
@@ -1,6 +1,6 @@
 /*
  * TextArea.java - Abstract jEdit Text Area component
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2005 Slava Pestov
@@ -31,6 +31,7 @@ import java.util.TooManyListenersException;
 import java.text.BreakIterator;
 import java.text.CharacterIterator;
 
+import javax.annotation.Nonnull;
 import javax.swing.*;
 import javax.swing.event.*;
 import java.awt.event.*;
@@ -69,7 +70,7 @@ import org.gjt.sp.util.ThreadUtilities;
  *
  * @author Slava Pestov
  * @author kpouer (rafactoring into standalone text area)
- * @version $Id: TextArea.java 22366 2012-10-13 22:21:34Z ezust $
+ * @version $Id: TextArea.java 22670 2013-01-12 12:29:48Z thomasmey $
  */
 public abstract class TextArea extends JComponent
 {
@@ -1708,6 +1709,7 @@ forward_scan:	do
 	 * Returns the current selection.
 	 * @since jEdit 3.2pre1
 	 */
+	@Nonnull
 	public Selection[] getSelection()
 	{
 		return selectionManager.getSelection();
@@ -4842,7 +4844,7 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 			displayManager.invalidateScreenLineCounts();
 			displayManager.notifyScreenLineChanges();
 		}
-		chunkCache.invalidateAll();
+		chunkCache.reset();
 		gutter.repaint();
 		painter.repaint();
 	} //}}}
diff --git a/org/gjt/sp/jedit/textarea/TextAreaBorder.java b/org/gjt/sp/jedit/textarea/TextAreaBorder.java
index 1a5d8a0..cc98937 100644
--- a/org/gjt/sp/jedit/textarea/TextAreaBorder.java
+++ b/org/gjt/sp/jedit/textarea/TextAreaBorder.java
@@ -1,6 +1,6 @@
 /*
  * TextAreaBorder.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2004 Slava Pestov
diff --git a/org/gjt/sp/jedit/textarea/TextAreaDropHandler.java b/org/gjt/sp/jedit/textarea/TextAreaDropHandler.java
index f8807cb..e18b4be 100644
--- a/org/gjt/sp/jedit/textarea/TextAreaDropHandler.java
+++ b/org/gjt/sp/jedit/textarea/TextAreaDropHandler.java
@@ -1,6 +1,6 @@
 /*
  * TextAreaTransferHandler.java - Drag and drop support
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2004 Slava Pestov
@@ -32,7 +32,7 @@ import org.gjt.sp.util.Log;
 
 /**
  * @author Slava Pestov
- * @version $Id: TextAreaDropHandler.java 17040 2010-01-23 14:19:47Z k_satoda $
+ * @version $Id: TextAreaDropHandler.java 21831 2012-06-18 22:54:17Z ezust $
  */
 class TextAreaDropHandler extends DropTargetAdapter
 {
diff --git a/org/gjt/sp/jedit/textarea/TextAreaException.java b/org/gjt/sp/jedit/textarea/TextAreaException.java
index 9d5282c..e567ba3 100644
--- a/org/gjt/sp/jedit/textarea/TextAreaException.java
+++ b/org/gjt/sp/jedit/textarea/TextAreaException.java
@@ -1,6 +1,6 @@
 /*
  * ServiceManager.java - Handles services.xml files in plugins
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
@@ -26,7 +26,7 @@ package org.gjt.sp.jedit.textarea;
  * It can be catched and an error dialog can be displayed.
  *
  * @author Matthieu Casanova
- * @version $Id: TextAreaException.java 15570 2009-06-25 00:43:57Z ezust $
+ * @version $Id: TextAreaException.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public class TextAreaException extends Exception
 {
diff --git a/org/gjt/sp/jedit/textarea/TextAreaExtension.java b/org/gjt/sp/jedit/textarea/TextAreaExtension.java
index 2454ed4..52963d4 100644
--- a/org/gjt/sp/jedit/textarea/TextAreaExtension.java
+++ b/org/gjt/sp/jedit/textarea/TextAreaExtension.java
@@ -1,6 +1,6 @@
 /*
  * TextAreaExtension.java - Custom painter and tool tip handler
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2002 Slava Pestov
@@ -36,7 +36,7 @@ import java.awt.Graphics2D;
  * @since jEdit 4.0pre4
  *
  * @author Slava Pestov
- * @version $Id: TextAreaExtension.java 15570 2009-06-25 00:43:57Z ezust $
+ * @version $Id: TextAreaExtension.java 21831 2012-06-18 22:54:17Z ezust $
  */
 public abstract class TextAreaExtension
 {
diff --git a/org/gjt/sp/jedit/textarea/TextAreaMouseHandler.java b/org/gjt/sp/jedit/textarea/TextAreaMouseHandler.java
index f59ad34..68ed567 100644
--- a/org/gjt/sp/jedit/textarea/TextAreaMouseHandler.java
+++ b/org/gjt/sp/jedit/textarea/TextAreaMouseHandler.java
@@ -1,6 +1,6 @@
 /*
  * TextAreaMouseHandler.java - standalone mouse handler for textarea
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
@@ -33,7 +33,7 @@ import java.awt.*;
 /** Standalone TextArea MouseHandler.
  *
  * @author Matthieu Casanova
- * @version $Id: TextAreaMouseHandler.java 19363 2011-02-14 11:59:42Z kpouer $
+ * @version $Id: TextAreaMouseHandler.java 22883 2013-03-23 17:58:56Z thomasmey $
  */
 public class TextAreaMouseHandler extends MouseInputAdapter
 {
@@ -206,7 +206,7 @@ public class TextAreaMouseHandler extends MouseInputAdapter
 		{
 			Point p = textArea.offsetToXY(dragStart);
 			// defer scrolling until mouserelease if result is off-screen
-			textArea.moveCaretPosition(dragStart, (p.x < 0) ? textArea.NO_SCROLL : textArea.NORMAL_SCROLL);
+			textArea.moveCaretPosition(dragStart, (p.x < 0) ? TextArea.NO_SCROLL : TextArea.NORMAL_SCROLL);
 		}
 
 		if(!(textArea.isMultipleSelectionEnabled()
@@ -383,7 +383,7 @@ public class TextAreaMouseHandler extends MouseInputAdapter
 			if(dot != textArea.getCaretPosition())
 			{
 				// defer scroll to mouserelease if result is offscreen left without dragging that direction
-				textArea.moveCaretPosition(dot, (p.x < 0 && x > 1) ? textArea.NO_SCROLL : textArea.NORMAL_SCROLL);
+				textArea.moveCaretPosition(dot, (p.x < 0 && x > 1) ? TextArea.NO_SCROLL : TextArea.NORMAL_SCROLL);
 			}
 			else if(p.x < 0 && x < 1)
 			{
diff --git a/org/gjt/sp/jedit/textarea/TextAreaPainter.java b/org/gjt/sp/jedit/textarea/TextAreaPainter.java
index 58a0c7d..d680de0 100644
--- a/org/gjt/sp/jedit/textarea/TextAreaPainter.java
+++ b/org/gjt/sp/jedit/textarea/TextAreaPainter.java
@@ -1,6 +1,6 @@
 /*
  * TextAreaPainter.java - Paints the text area
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2005 Slava Pestov
@@ -54,7 +54,7 @@ import org.gjt.sp.util.Log;
  * @see TextArea
  *
  * @author Slava Pestov
- * @version $Id: TextAreaPainter.java 20109 2011-10-18 12:25:29Z evanpw $
+ * @version $Id: TextAreaPainter.java 23084 2013-07-27 16:11:13Z ezust $
  */
 public class TextAreaPainter extends JComponent implements TabExpander
 {
@@ -266,7 +266,7 @@ public class TextAreaPainter extends JComponent implements TabExpander
 	{
 		this.styles = styles;
 		styles[Token.NULL] = new SyntaxStyle(getForeground(),null,getFont());
-		textArea.chunkCache.invalidateAll();
+		textArea.chunkCache.reset();
 		repaint();
 	} //}}}
 
@@ -622,7 +622,7 @@ public class TextAreaPainter extends JComponent implements TabExpander
 	public final void setFoldLineStyle(SyntaxStyle[] foldLineStyle)
 	{
 		this.foldLineStyle = foldLineStyle;
-		textArea.chunkCache.invalidateAll();
+		textArea.chunkCache.reset();
 		repaint();
 	} //}}}
 
@@ -1477,16 +1477,19 @@ public class TextAreaPainter extends JComponent implements TabExpander
 
 			if(textArea.isOverwriteEnabled())
 			{
-				gfx.drawLine(caretX, y + lineHeight - 1,
-					     caretX + textArea.charWidth,
-					     y + lineHeight - 1);
+				if (thickCaret) 
+					gfx.fillRect(caretX, y + lineHeight - 4, textArea.charWidth, 3);
+				
+				else  gfx.drawLine(caretX, y + lineHeight - 1, 
+					caretX + textArea.charWidth, y + lineHeight - 1);
 			}
 			else if(blockCaret)
-				gfx.drawRect(caretX, y + charOffset, textArea.charWidth - 1, charHeight - 1);
+				gfx.drawRect(caretX, y + charOffset, 
+					textArea.charWidth - 1, charHeight - 1);
 			else
 			{
-				if (thickCaret)
-					gfx.drawRect(caretX, y + charOffset, 1, charHeight - 1);
+				if (thickCaret) 
+					gfx.fillRect(caretX, y + charOffset, 3, charHeight - 1);
 				else
 					gfx.drawLine(caretX, y + charOffset, caretX, 
 						     y + charOffset + charHeight - 1);
diff --git a/org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java b/org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
index 15b87b3..5800098 100644
--- a/org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
+++ b/org/gjt/sp/jedit/textarea/TextAreaTransferHandler.java
@@ -1,6 +1,6 @@
 /*
  * TextAreaTransferHandler.java - Drag and drop support
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2004 Slava Pestov
@@ -24,13 +24,15 @@ package org.gjt.sp.jedit.textarea;
 
 //{{{ Imports
 import org.gjt.sp.jedit.*;
+import org.gjt.sp.jedit.bufferio.IoTask;
 import org.gjt.sp.jedit.bufferset.BufferSetManager;
 import org.gjt.sp.jedit.browser.VFSBrowser;
 import org.gjt.sp.jedit.io.FileVFS;
 import org.gjt.sp.jedit.io.VFS;
 import org.gjt.sp.jedit.io.VFSManager;
+import org.gjt.sp.util.AwtRunnableQueue;
 import org.gjt.sp.util.Log;
-import org.gjt.sp.util.WorkRequest;
+import org.gjt.sp.util.ThreadUtilities;
 
 import javax.swing.*;
 import java.awt.datatransfer.DataFlavor;
@@ -43,7 +45,7 @@ import java.util.List;
 
 /**
  * @author Slava Pestov
- * @version $Id: TextAreaTransferHandler.java 19698 2011-07-23 12:22:01Z shlomy $
+ * @version $Id: TextAreaTransferHandler.java 22943 2013-04-22 11:44:40Z thomasmey $
  */
 public class TextAreaTransferHandler extends TransferHandler
 {
@@ -231,7 +233,7 @@ public class TextAreaTransferHandler extends TransferHandler
 						}
 						else
 						{
-							VFSManager.runInAWTThread(new DraggedURLLoader(textArea,uri.getPath()));
+							AwtRunnableQueue.INSTANCE.runAfterIoTasks(new DraggedURLLoader(textArea,uri.getPath()));
 						}
 						found = true;
 					}
@@ -287,7 +289,7 @@ public class TextAreaTransferHandler extends TransferHandler
 						str0 = str0.substring(7);
 					}
 
-					VFSManager.runInWorkThread(new DraggedURLLoader(textArea, str0));
+					ThreadUtilities.runInBackground(new DraggedURLLoader(textArea, str0));
 				}
 				found = true;
 
@@ -482,17 +484,18 @@ public class TextAreaTransferHandler extends TransferHandler
 	} //}}}
 
 	//{{{ DraggedURLLoader class
-	private static class DraggedURLLoader extends WorkRequest
+	private static class DraggedURLLoader extends IoTask
 	{
 		private final JEditTextArea textArea;
 		private final String url;
 		
 		DraggedURLLoader(JEditTextArea textArea, String url)
 		{
+			super();
 			this.textArea = textArea;
 			this.url = url;
 		}
-		public void run()
+		public void _run()
 		{
 			EditPane editPane = EditPane.get(textArea);
 			jEdit.openFile(editPane,url);
diff --git a/org/gjt/sp/jedit/textarea/TriangleFoldPainter.java b/org/gjt/sp/jedit/textarea/TriangleFoldPainter.java
index c53c974..75ba37c 100644
--- a/org/gjt/sp/jedit/textarea/TriangleFoldPainter.java
+++ b/org/gjt/sp/jedit/textarea/TriangleFoldPainter.java
@@ -1,74 +1,74 @@
-/*
- * TriangleFoldPainter.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=0:
- *
- * Copyright (C) 1999, 2000 mike dillon
- * Portions copyright (C) 2001, 2002 Slava Pestov
- * Refactoring copyright (C) 2008 Shlomy Reinstein
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.jedit.textarea;
-
-import java.awt.Graphics2D;
-import org.gjt.sp.jedit.buffer.JEditBuffer;
-
-// {{{ class TriangleFoldHandler
-public class TriangleFoldPainter implements FoldPainter
-{
-	// {{{ paintFoldStart()
-	public void paintFoldStart(Gutter gutter, Graphics2D gfx, int screenLine,
-			int physicalLine, boolean nextLineVisible, int y, int lineHeight,
-			JEditBuffer buffer)
-	{
-		int _y = y + lineHeight / 2;
-		gfx.setColor(gutter.getFoldColor());
-		if (nextLineVisible)
-		{
-			gfx.drawLine(1,_y - 3,10,_y - 3);
-			gfx.drawLine(2,_y - 2,9,_y - 2);
-			gfx.drawLine(3,_y - 1,8,_y - 1);
-			gfx.drawLine(4,_y,7,_y);
-			gfx.drawLine(5,_y + 1,6,_y + 1);
-		}
-		else
-		{
-			gfx.drawLine(4,_y - 5,4,_y + 4);
-			gfx.drawLine(5,_y - 4,5,_y + 3);
-			gfx.drawLine(6,_y - 3,6,_y + 2);
-			gfx.drawLine(7,_y - 2,7,_y + 1);
-			gfx.drawLine(8,_y - 1,8,_y);
-		}
-	} // }}}
-
-	// {{{ paintFoldEnd()
-	public void paintFoldEnd(Gutter gutter, Graphics2D gfx, int screenLine,
-			int physicalLine, int y, int lineHeight, JEditBuffer buffer)
-	{
-		gfx.setColor(gutter.getFoldColor());
-		int _y = y + lineHeight / 2;
-		gfx.drawLine(4,_y,4,_y + 3);
-		gfx.drawLine(4,_y + 3,7,_y + 3);
-	} // }}}
-
-	// {{{ paintFoldMiddle()
-	public void paintFoldMiddle(Gutter gutter, Graphics2D gfx, int screenLine,
-			int physicalLine, int y, int lineHeight, JEditBuffer buffer)
-	{
-	} // }}}
-
-}// }}}
+/*
+ * TriangleFoldPainter.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=0:
+ *
+ * Copyright (C) 1999, 2000 mike dillon
+ * Portions copyright (C) 2001, 2002 Slava Pestov
+ * Refactoring copyright (C) 2008 Shlomy Reinstein
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.jedit.textarea;
+
+import java.awt.Graphics2D;
+import org.gjt.sp.jedit.buffer.JEditBuffer;
+
+// {{{ class TriangleFoldHandler
+public class TriangleFoldPainter implements FoldPainter
+{
+	// {{{ paintFoldStart()
+	public void paintFoldStart(Gutter gutter, Graphics2D gfx, int screenLine,
+			int physicalLine, boolean nextLineVisible, int y, int lineHeight,
+			JEditBuffer buffer)
+	{
+		int _y = y + lineHeight / 2;
+		gfx.setColor(gutter.getFoldColor());
+		if (nextLineVisible)
+		{
+			gfx.drawLine(1,_y - 3,10,_y - 3);
+			gfx.drawLine(2,_y - 2,9,_y - 2);
+			gfx.drawLine(3,_y - 1,8,_y - 1);
+			gfx.drawLine(4,_y,7,_y);
+			gfx.drawLine(5,_y + 1,6,_y + 1);
+		}
+		else
+		{
+			gfx.drawLine(4,_y - 5,4,_y + 4);
+			gfx.drawLine(5,_y - 4,5,_y + 3);
+			gfx.drawLine(6,_y - 3,6,_y + 2);
+			gfx.drawLine(7,_y - 2,7,_y + 1);
+			gfx.drawLine(8,_y - 1,8,_y);
+		}
+	} // }}}
+
+	// {{{ paintFoldEnd()
+	public void paintFoldEnd(Gutter gutter, Graphics2D gfx, int screenLine,
+			int physicalLine, int y, int lineHeight, JEditBuffer buffer)
+	{
+		gfx.setColor(gutter.getFoldColor());
+		int _y = y + lineHeight / 2;
+		gfx.drawLine(4,_y,4,_y + 3);
+		gfx.drawLine(4,_y + 3,7,_y + 3);
+	} // }}}
+
+	// {{{ paintFoldMiddle()
+	public void paintFoldMiddle(Gutter gutter, Graphics2D gfx, int screenLine,
+			int physicalLine, int y, int lineHeight, JEditBuffer buffer)
+	{
+	} // }}}
+
+}// }}}
diff --git a/org/gjt/sp/jedit/visitors/JEditVisitor.java b/org/gjt/sp/jedit/visitors/JEditVisitor.java
index 2ea0724..8fb6b8c 100644
--- a/org/gjt/sp/jedit/visitors/JEditVisitor.java
+++ b/org/gjt/sp/jedit/visitors/JEditVisitor.java
@@ -1,6 +1,6 @@
 /*
  * JEditVisitor.java - A Visitor pattern for jEdit
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/visitors/JEditVisitorAdapter.java b/org/gjt/sp/jedit/visitors/JEditVisitorAdapter.java
index 4f06284..0eed008 100644
--- a/org/gjt/sp/jedit/visitors/JEditVisitorAdapter.java
+++ b/org/gjt/sp/jedit/visitors/JEditVisitorAdapter.java
@@ -1,6 +1,6 @@
 /*
  * JEditVisitorAdapter.java - A default JEditVisitor implementation
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/jedit/visitors/SaveCaretInfoVisitor.java b/org/gjt/sp/jedit/visitors/SaveCaretInfoVisitor.java
index 01aab23..651b693 100644
--- a/org/gjt/sp/jedit/visitors/SaveCaretInfoVisitor.java
+++ b/org/gjt/sp/jedit/visitors/SaveCaretInfoVisitor.java
@@ -1,7 +1,7 @@
 /*
  * SaveCaretInfoVisitor.java - A visitor that saves the caret info of
  * an EditPane
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2008 Matthieu Casanova
diff --git a/org/gjt/sp/util/AwtRunnableQueue.java b/org/gjt/sp/util/AwtRunnableQueue.java
new file mode 100644
index 0000000..f870da0
--- /dev/null
+++ b/org/gjt/sp/util/AwtRunnableQueue.java
@@ -0,0 +1,168 @@
+/*
+ * AwtRunnableQueue.java - Queue for task to run in the Event Dispatch Thread
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2012 Thomas Meyer
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.util;
+
+import java.awt.EventQueue;
+import java.util.LinkedList;
+
+import javax.annotation.concurrent.GuardedBy;
+import javax.annotation.concurrent.ThreadSafe;
+
+/**
+ * A queue for runnables that should run in the EDT after all pending 
+ * IO tasks are finished
+ * @author Thomas Meyer
+ * @since jEdit 5.1pre1
+ */
+ at ThreadSafe
+public enum AwtRunnableQueue
+{
+	INSTANCE;
+
+	@GuardedBy("this") private boolean awtQueueStarted;
+	@GuardedBy("this") private boolean awtRunnerQueued;
+	@GuardedBy("this") private final LinkedList<Runnable> awtQueue;
+
+	//{{{ Constructor method
+	private AwtRunnableQueue()
+	{
+		awtQueue = new LinkedList<Runnable>();
+	} //}}}
+
+	//{{{ start() method
+	/**
+	 * Queue the AWT runner for the first time.
+	 */
+	public void start()
+	{
+		synchronized (this)
+		{
+			awtQueueStarted = true;
+		}
+		queueAWTRunner(false);
+	} //}}}
+
+
+	//{{{ runAfterIoTasks() method
+	/**
+	 * Adds a runnable to the AWT queue to run in the EDT 
+	 * after all pending IO tasks are finished
+	 * @param run The runnable to queue for execution in the EDT after all IO tasks
+	 */
+	public void runAfterIoTasks(Runnable run)
+	{
+		boolean runDirectly = false;
+
+		//{{{ if there are no requests, execute AWT requests immediately
+		synchronized (this)
+		{
+			if(awtQueueStarted &&
+			   TaskManager.instance.countIoTasks() == 0 &&
+			   awtQueue.isEmpty())
+				runDirectly = true;
+		}
+		if(runDirectly)
+		{
+//			Log.log(Log.DEBUG,this,"AWT immediate: " + run);
+			ThreadUtilities.runInDispatchThread(run);
+			return;
+		} //}}}
+
+		synchronized (this)
+		{
+			awtQueue.offer(run);
+		}
+
+		// queue AWT request
+		queueAWTRunner(false);
+	} //}}}
+
+	//{{{ queueAWTRunner() method
+	public void queueAWTRunner(boolean wait)
+	{
+		if(wait)
+			ThreadUtilities.runInDispatchThreadAndWait(new RunRequestsInAWTThread());
+		else
+		{
+			synchronized (this)
+			{
+				if(awtQueue.isEmpty())
+					return;
+
+				if(!awtQueueStarted || awtRunnerQueued)
+					return;
+
+				awtRunnerQueued = true;
+			}
+
+			EventQueue.invokeLater(new RunRequestsInAWTThread());
+//			Log.log(Log.DEBUG,this,"AWT runner queued");
+		}
+	} //}}}
+
+	//{{{ RunRequestsInAWTThread class
+	private class RunRequestsInAWTThread implements Runnable
+	{
+		public void run()
+		{
+			Runnable nextRunnable;
+			// enable queuing of AWT runner again
+			synchronized (AwtRunnableQueue.this)
+			{
+				awtRunnerQueued = false;
+				nextRunnable = awtQueue.peek();
+			}
+			while(TaskManager.instance.countIoTasks() == 0 && nextRunnable != null)
+			{
+				doAWTRequest(nextRunnable);
+				synchronized (AwtRunnableQueue.this)
+				{
+					// consume current entry
+					awtQueue.poll();
+					nextRunnable = awtQueue.peek();
+				}
+			}
+		}
+
+		//{{{ doAWTRequest() method
+		/**
+		 * Actually run the Runnable
+		 * @param request the request to run
+		 */
+		private void doAWTRequest(Runnable request)
+		{
+//			Log.log(Log.DEBUG,this,"Running in AWT thread: " + request);
+
+			try
+			{
+				request.run();
+			}
+			catch(Throwable t)
+			{
+				Log.log(Log.ERROR,this,"Exception "
+					+ "in AWT thread:");
+				Log.log(Log.ERROR,this,t);
+			}
+		} //}}}
+	} //}}}
+}
diff --git a/org/gjt/sp/util/EnhancedTreeCellRenderer.java b/org/gjt/sp/util/EnhancedTreeCellRenderer.java
index 28c4a19..c905bd9 100644
--- a/org/gjt/sp/util/EnhancedTreeCellRenderer.java
+++ b/org/gjt/sp/util/EnhancedTreeCellRenderer.java
@@ -1,6 +1,6 @@
 /*
  * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright © 2011 jEdit contributors
diff --git a/org/gjt/sp/util/HtmlUtilities.java b/org/gjt/sp/util/HtmlUtilities.java
index ea887d1..05ebad0 100644
--- a/org/gjt/sp/util/HtmlUtilities.java
+++ b/org/gjt/sp/util/HtmlUtilities.java
@@ -1,192 +1,192 @@
-/*
- * HtmlUtilities.java - HTML utility functions
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 Shlomy Reinstein
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.util;
-
-import java.awt.Color;
-import java.awt.Font;
-import java.util.List;
-
-import org.gjt.sp.jedit.syntax.SyntaxStyle;
-
-/**
- * HTML utility methods for conversion of strings to HTML and highlighting matches
- * in search results.
- * Some of these methods were moved here from HyperSearchResults.HighlightingTree
- * to make them available for plugins.
- *
- * @author Shlomy Reinstein
- * @version $Id: $
- * @since 4.4pre1
- */
-
-public class HtmlUtilities
-{
-	//{{{ public section
-
-	//{{{ parseHighlightStyle()
-	/**
-	 * Parses a string specifying a syntax highlight style.
-	 *
-	 * The syntax highlight string should be in the same format used to
-	 * store syntax highlight styles in the properties.
-	 *
-	 * @param style The syntax highlight style string.
-	 * @param f The font to which the syntax style will apply.
-	 * @return The SyntaxStyle object represented by the style string.
-	 */
-	public static SyntaxStyle parseHighlightStyle(String style, Font f)
-	{
-		SyntaxStyle s;
-		try
-		{
-			s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true, null);
-		}
-		catch (Exception e)
-		{
-			style = "color:#000000";
-			s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true);
-		}
-		return s;
-	} //}}}
-
-	//{{{ style2html()
-	/**
-	 * Parses a string specifying a syntax highlight style, and creates an
-	 * HTML representation for it.
-	 *
-	 * The syntax highlight string should be in the same format used to
-	 * store syntax highlight styles in the properties.
-	 *
-	 * @param prop The syntax highlight style string.
-	 * @param f The font to which the syntax style will apply.
-	 * @return The HTML representation of the given syntax style. 
-	 */
-	public static String style2html(String prop, Font f)
-	{
-		StringBuilder tag = new StringBuilder();
-		SyntaxStyle style = parseHighlightStyle(prop, f);
-		Color c = style.getForegroundColor();
-		if (c != null)
-			tag.append("color:").append(color2html(c));
-		c = style.getBackgroundColor();
-		if (c != null)
-			tag.append("background:").append(color2html(c));
-		f = style.getFont();
-		if (f.isBold())
-			tag.append("font-weight:bold;");
-		if (f.isItalic())
-			tag.append("font-style: italic;");
-		return tag.toString();
-	} //}}}
-
-	//{{{ highlightString()
-	/**
-	 * Creates an HTML presentation of a given string, where selected substrings
-	 * are highlighted with a given syntax style tag.
-	 *
-	 * @param s The (non-HTML) string to highlight. 
-	 * @param styleTag The HTML string representing the highlight style.
-	 * @param ranges The indices of the substrings to highlight, in pairs: The start
-	 *               index of a substring followed by the end index of the substring.
-	 * @return The HTML representation of the string with highlighted substrings. 
-	 */
-	public static String highlightString(String s, String styleTag, List<Integer> ranges)
-	{
-		StringBuilder sb = new StringBuilder("<html><style>.highlight {");
-		sb.append(styleTag);
-		sb.append("}</style><body>");
-		int lastIndex = 0;
-		for (int i = 0; i < ranges.size(); i += 2)
-		{
-			int rangeStart = ranges.get(i);
-			int rangeEnd = ranges.get(i + 1);
-			appendString2html(sb, s.substring(lastIndex, rangeStart));
-			sb.append("<span class=\"highlight\">");
-			appendString2html(sb, s.substring(rangeStart, rangeEnd));
-			sb.append("</span>");
-			lastIndex = rangeEnd;
-		}
-		appendString2html(sb, s.substring(lastIndex));
-		sb.append("</body></html>");
-		return sb.toString();
-	} //}}}
-
-	//{{{ appendString2html
-	/**
-	 * Appends a given non-HTML string to an HTML string, translating character
-	 * entities to the appropriate HTML form.
-	 * 
-	 * @param sb The HTML string to which the non-HTML string is appended.
-	 * @param s The non-HTML string to append.
-	 */
-	public static void appendString2html(StringBuilder sb, String s)
-	{
-		for (int i = 0; i < s.length(); i++)
-		{
-			char c = s.charAt(i);
-			String r;
-			switch (c)
-			{
-			case '"':
-				r = """;
-				break;
-			// case '\'': r = "'"; break;
-			case '&':
-				r = "&";
-				break;
-			case '<':
-				r = "<";
-				break;
-			case '>':
-				r = ">";
-				break;
-			case ' ':
-				r = " ";	// Maintain amount of whitespace in line
-				break;
-			default:
-				r = String.valueOf(c);
-				break;
-			}
-			sb.append(r);
-		}
-	} //}}}
-	
-	//}}}
-
-	//{{{ private section
-
-	//{{{ color2html()
-	private static String color2html(Color c)
-	{
-		StringBuilder cs = new StringBuilder("rgb(");
-		cs.append(c.getRed());
-		cs.append(",");
-		cs.append(c.getGreen());
-		cs.append(",");
-		cs.append(c.getBlue());
-		cs.append(");");
-		return cs.toString();
-	} //}}}
-
-	//}}}
-}
+/*
+ * HtmlUtilities.java - HTML utility functions
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010 Shlomy Reinstein
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.gjt.sp.util;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.util.List;
+
+import org.gjt.sp.jedit.syntax.SyntaxStyle;
+
+/**
+ * HTML utility methods for conversion of strings to HTML and highlighting matches
+ * in search results.
+ * Some of these methods were moved here from HyperSearchResults.HighlightingTree
+ * to make them available for plugins.
+ *
+ * @author Shlomy Reinstein
+ * @version $Id: $
+ * @since 4.4pre1
+ */
+
+public class HtmlUtilities
+{
+	//{{{ public section
+
+	//{{{ parseHighlightStyle()
+	/**
+	 * Parses a string specifying a syntax highlight style.
+	 *
+	 * The syntax highlight string should be in the same format used to
+	 * store syntax highlight styles in the properties.
+	 *
+	 * @param style The syntax highlight style string.
+	 * @param f The font to which the syntax style will apply.
+	 * @return The SyntaxStyle object represented by the style string.
+	 */
+	public static SyntaxStyle parseHighlightStyle(String style, Font f)
+	{
+		SyntaxStyle s;
+		try
+		{
+			s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true, null);
+		}
+		catch (Exception e)
+		{
+			style = "color:#000000";
+			s = SyntaxUtilities.parseStyle(style, f.getFamily(), f.getSize(), true);
+		}
+		return s;
+	} //}}}
+
+	//{{{ style2html()
+	/**
+	 * Parses a string specifying a syntax highlight style, and creates an
+	 * HTML representation for it.
+	 *
+	 * The syntax highlight string should be in the same format used to
+	 * store syntax highlight styles in the properties.
+	 *
+	 * @param prop The syntax highlight style string.
+	 * @param f The font to which the syntax style will apply.
+	 * @return The HTML representation of the given syntax style. 
+	 */
+	public static String style2html(String prop, Font f)
+	{
+		StringBuilder tag = new StringBuilder();
+		SyntaxStyle style = parseHighlightStyle(prop, f);
+		Color c = style.getForegroundColor();
+		if (c != null)
+			tag.append("color:").append(color2html(c));
+		c = style.getBackgroundColor();
+		if (c != null)
+			tag.append("background:").append(color2html(c));
+		f = style.getFont();
+		if (f.isBold())
+			tag.append("font-weight:bold;");
+		if (f.isItalic())
+			tag.append("font-style: italic;");
+		return tag.toString();
+	} //}}}
+
+	//{{{ highlightString()
+	/**
+	 * Creates an HTML presentation of a given string, where selected substrings
+	 * are highlighted with a given syntax style tag.
+	 *
+	 * @param s The (non-HTML) string to highlight. 
+	 * @param styleTag The HTML string representing the highlight style.
+	 * @param ranges The indices of the substrings to highlight, in pairs: The start
+	 *               index of a substring followed by the end index of the substring.
+	 * @return The HTML representation of the string with highlighted substrings. 
+	 */
+	public static String highlightString(String s, String styleTag, List<Integer> ranges)
+	{
+		StringBuilder sb = new StringBuilder("<html><style>.highlight {");
+		sb.append(styleTag);
+		sb.append("}</style><body>");
+		int lastIndex = 0;
+		for (int i = 0; i < ranges.size(); i += 2)
+		{
+			int rangeStart = ranges.get(i);
+			int rangeEnd = ranges.get(i + 1);
+			appendString2html(sb, s.substring(lastIndex, rangeStart));
+			sb.append("<span class=\"highlight\">");
+			appendString2html(sb, s.substring(rangeStart, rangeEnd));
+			sb.append("</span>");
+			lastIndex = rangeEnd;
+		}
+		appendString2html(sb, s.substring(lastIndex));
+		sb.append("</body></html>");
+		return sb.toString();
+	} //}}}
+
+	//{{{ appendString2html
+	/**
+	 * Appends a given non-HTML string to an HTML string, translating character
+	 * entities to the appropriate HTML form.
+	 * 
+	 * @param sb The HTML string to which the non-HTML string is appended.
+	 * @param s The non-HTML string to append.
+	 */
+	public static void appendString2html(StringBuilder sb, String s)
+	{
+		for (int i = 0; i < s.length(); i++)
+		{
+			char c = s.charAt(i);
+			String r;
+			switch (c)
+			{
+			case '"':
+				r = """;
+				break;
+			// case '\'': r = "'"; break;
+			case '&':
+				r = "&";
+				break;
+			case '<':
+				r = "<";
+				break;
+			case '>':
+				r = ">";
+				break;
+			case ' ':
+				r = " ";	// Maintain amount of whitespace in line
+				break;
+			default:
+				r = String.valueOf(c);
+				break;
+			}
+			sb.append(r);
+		}
+	} //}}}
+	
+	//}}}
+
+	//{{{ private section
+
+	//{{{ color2html()
+	private static String color2html(Color c)
+	{
+		StringBuilder cs = new StringBuilder("rgb(");
+		cs.append(c.getRed());
+		cs.append(",");
+		cs.append(c.getGreen());
+		cs.append(",");
+		cs.append(c.getBlue());
+		cs.append(");");
+		return cs.toString();
+	} //}}}
+
+	//}}}
+}
diff --git a/org/gjt/sp/util/IOUtilities.java b/org/gjt/sp/util/IOUtilities.java
index b5fe46d..a1f4265 100644
--- a/org/gjt/sp/util/IOUtilities.java
+++ b/org/gjt/sp/util/IOUtilities.java
@@ -1,6 +1,6 @@
 /*
  * IOUtilities.java - IO related functions
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
@@ -23,12 +23,13 @@
 package org.gjt.sp.util;
 
 import java.io.*;
+import javax.annotation.Nullable;
 
 /**
  * IO tools that depend on JDK only.
  *
  * @author Matthieu Casanova
- * @version $Id: IOUtilities.java 19107 2010-12-08 18:49:10Z ezust $
+ * @version $Id: IOUtilities.java 22995 2013-05-17 09:27:17Z kpouer $
  * @since 4.3pre5
  */
 public class IOUtilities
@@ -92,7 +93,7 @@ public class IOUtilities
 	 * @return <code>true</code> if the copy was done, <code>false</code> if it was interrupted
 	 * @throws IOException  IOException If an I/O error occurs
 	 */
-	public static boolean copyStream(int bufferSize, ProgressObserver progress,
+	public static boolean copyStream(int bufferSize, @Nullable ProgressObserver progress,
 					InputStream in, OutputStream out, boolean canStop)
 		throws IOException
 	{
@@ -108,7 +109,7 @@ public class IOUtilities
 				progress.setStatus(StandardUtilities.formatFileSize(copied));
 				progress.setValue(copied);
 			}
-			if(canStop && Thread.interrupted()) 
+			if(canStop && Thread.interrupted())
 				return false;
 		}
 		return true;
@@ -124,7 +125,7 @@ public class IOUtilities
 	 * @return <code>true</code> if the copy was done, <code>false</code> if it was interrupted
 	 * @throws IOException  IOException If an I/O error occurs
 	 */
-	public static boolean copyStream(ProgressObserver progress,
+	public static boolean copyStream(@Nullable ProgressObserver progress,
 					 InputStream in, OutputStream out, boolean canStop)
 		throws IOException
 	{
@@ -147,9 +148,12 @@ public class IOUtilities
 		else if (file.isDirectory())
 		{
 			File[] files = file.listFiles();
-			for (int i = 0; i < files.length; i++)
+			if (files != null)
 			{
-				length += fileLength(files[i]);
+				for (int i = 0; i < files.length; i++)
+				{
+					length += fileLength(files[i]);
+				}
 			}
 		}
 		return length;
@@ -158,10 +162,13 @@ public class IOUtilities
 	//{{{ closeQuietly() methods
 	/**
 	 * Method that will close an {@link InputStream} ignoring it if it is null and ignoring exceptions.
-	 *
+	 * @deprecated we want to remove this method without breaking compatibility
+	 * with your plugin. Closeable works for this type as of Java5.
+	 * @see #closeQuietly(Closeable)
 	 * @param in the InputStream to close.
 	 */
-	public static void closeQuietly(InputStream in)
+	@Deprecated
+	public static void closeQuietly(@Nullable InputStream in)
 	{
 		if(in != null)
 		{
@@ -178,10 +185,13 @@ public class IOUtilities
 
 	/**
 	 * Method that will close an {@link OutputStream} ignoring it if it is null and ignoring exceptions.
-	 *
+	 * @deprecated we want to remove this method without breaking compatibility
+	 * with your plugin. Closeable works for this type as of Java5.
+	 * @see #closeQuietly(Closeable)
 	 * @param out the OutputStream to close.
 	 */
-	public static void closeQuietly(OutputStream out)
+	@Deprecated
+	public static void closeQuietly(@Nullable OutputStream out)
 	{
 		if(out != null)
 		{
@@ -206,11 +216,14 @@ public class IOUtilities
 
 	/**
 	 * Method that will close an {@link Reader} ignoring it if it is null and ignoring exceptions.
-	 *
+	 * @deprecated we want to remove this method without breaking compatibility
+	 * with your plugin. Closeable works for this type as of Java5.
+	 * @see #closeQuietly(Closeable)
 	 * @param r the Reader to close.
 	 * @since jEdit 4.3pre5
 	 */
-	public static void closeQuietly(Reader r)
+	@Deprecated
+	public static void closeQuietly(@Nullable Reader r)
 	{
 		if(r != null)
 		{
@@ -227,10 +240,13 @@ public class IOUtilities
 
 	/**
 	 * Method that will close a {@link Writer} ignoring it if it is null and ignoring exceptions.
-	 *
+	 * @deprecated we want to remove this method without breaking compatibility
+	 * with your plugin. Closeable works for this type as of Java5.
+	 * @see #closeQuietly(Closeable)
 	 * @param out the Writer to close.
 	 */
-	public static void closeQuietly(Writer out)
+	@Deprecated
+	public static void closeQuietly(@Nullable Writer out)
 	{
 		if(out != null)
 		{
@@ -254,12 +270,12 @@ public class IOUtilities
 	}
 
 	/**
-	 * Method that will close an {@link java.io.Closeable} ignoring it if it is null and ignoring exceptions.
+	 * Method that will close a {@link java.io.Closeable} ignoring it if it is null and ignoring exceptions.
 	 *
 	 * @param closeable the closeable to close.
 	 * @since jEdit 4.3pre8
 	 */
-	public static void closeQuietly(Closeable closeable)
+	public static void closeQuietly(@Nullable Closeable closeable)
 	{
 		if(closeable != null)
 		{
@@ -283,6 +299,49 @@ public class IOUtilities
 				//ignore
 			}
 		}
+	}
+
+
+	/**
+	 * Method that will close an {@link ObjectInput} ignoring it if it is null and ignoring exceptions.
+	 *
+	 * @param in the closeable to close.
+	 * @since jEdit 5.1pre1
+	 */
+	public void closeQuietly(@Nullable ObjectInput in)
+	{
+		if (in != null)
+		{
+			try
+			{
+				in.close();
+			}
+			catch (IOException e)
+			{
+				// ignore
+		}
+		}
+	}
+
+
+	/**
+	 * Method that will close an {@link ObjectOutput} ignoring it if it is null and ignoring exceptions.
+	 * @param out the closeable to close.
+	 * @since jEdit 5.1pre1
+	 */
+	public void closeQuietly(@Nullable ObjectOutput out)
+	{
+		if (out != null)
+		{
+			try
+			{
+				out.close();
+			}
+			catch (IOException e)
+			{
+				// ignore
+			}
+		}
 	} //}}}
 
 	//{{{ IOUtilities() constructor
diff --git a/org/gjt/sp/util/IntegerArray.java b/org/gjt/sp/util/IntegerArray.java
index ce12ed2..914ec74 100644
--- a/org/gjt/sp/util/IntegerArray.java
+++ b/org/gjt/sp/util/IntegerArray.java
@@ -1,6 +1,6 @@
 /*
  * IntegerArray.java - Automatically growing array of ints
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001 Slava Pestov
diff --git a/org/gjt/sp/util/Log.java b/org/gjt/sp/util/Log.java
index 8257ba9..a7be609 100644
--- a/org/gjt/sp/util/Log.java
+++ b/org/gjt/sp/util/Log.java
@@ -1,6 +1,6 @@
 /*
  * Log.java - A class for logging events
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2003 Slava Pestov
@@ -23,6 +23,7 @@
 package org.gjt.sp.util;
 
 //{{{ Imports
+import java.awt.Toolkit;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
@@ -53,10 +54,11 @@ import static java.text.DateFormat.MEDIUM;
  *
  * Logging of exception tracebacks is supported.<p>
  *
- * This class can also optionally redirect standard output and error to the log.
+ * This class can also optionally redirect standard output and error
+ * to the log, see {@link #init}.
  *
  * @author Slava Pestov
- * @version $Id: Log.java 19450 2011-03-14 21:23:20Z shlomy $
+ * @version $Id: Log.java 22935 2013-04-17 17:24:33Z ezust $
  */
 public class Log
 {
@@ -107,9 +109,13 @@ public class Log
 	/**
 	 * Initializes the log.
 	 * @param stdio If true, standard output and error will be
-	 * sent to the log
+	 * intercepted and sent to the log. The <code>urgency</code>
+	 * for these implicit log entries is <code>NOTICE</code>
+	 * and <code>ERROR</code> accordingly. Note that in such a situation
+	 * <code>System.out.print()</code> calls will not appear on standard
+	 * output, if default output level is higher than <code>NOTICE</code>.
 	 * @param level Messages with this log level or higher will
-	 * be printed to the system console
+	 * be printed to the system console.
 	 * @since jEdit 3.2pre4
 	 */
 	public static void init(boolean stdio, int level)
@@ -181,6 +187,26 @@ public class Log
 		Log.stream = stream;
 	} //}}}
 
+	//{{{ get/setBeepOnOutput method
+	/**
+	 * @since jEdit 5.1pre1
+	 */
+	public static boolean getBeepOnOutput()
+	{
+		return beepOnOutput;
+	}
+
+	/**
+	 * When <code>beepOnOutput</code> is set, every output going to standard
+	 * error is signaled by a standard beep. This is intended for debugging
+	 * purposes, to allow for immediate problem detection.
+	 * @since jEdit 5.1pre1
+	 */
+	public static void setBeepOnOutput(boolean beepOnOutput)
+	{
+		Log.beepOnOutput = beepOnOutput;
+	} //}}}
+
 	//{{{ flushStream() method
 	/**
 	 * Flushes the log stream.
@@ -286,7 +312,7 @@ public class Log
 			}
 		}
 		else if(source instanceof Class)
-			_source = ((Class)source).getName();
+			_source = ((Class<?>)source).getName();
 		else
 			_source = source.getClass().getName();
 		int index = _source.lastIndexOf('.');
@@ -335,6 +361,10 @@ public class Log
 	private static final DateFormat timeFormat;
 	private static final int MAX_THROWABLES = 10;
 	public static final List<Throwable> throwables;
+	// initialized externally through setBeepOnOutput method
+	private static boolean beepOnOutput = false;
+	// to prevent too much beeping we remember last beep time
+	private static long lastBeepTime = 0;
 	//}}}
 
 	//{{{ Class initializer
@@ -416,6 +446,17 @@ public class Log
 				realErr.println(fullMessage);
 			else
 				realOut.println(fullMessage);
+
+			if (beepOnOutput)
+			{
+				long time = System.currentTimeMillis();
+				
+				if (time - lastBeepTime > 1000)
+				{
+					Toolkit.getDefaultToolkit().beep();
+					lastBeepTime = System.currentTimeMillis();
+				}
+			}
 		}
 	} //}}}
 
@@ -483,7 +524,7 @@ public class Log
 		} //}}}
 
 		//{{{ getElementAt() method
-		public Object getElementAt(int index)
+		public String getElementAt(int index)
 		{
 			if(wrap)
 			{
diff --git a/org/gjt/sp/util/ProgressObserver.java b/org/gjt/sp/util/ProgressObserver.java
index c6ecb46..d0d216c 100644
--- a/org/gjt/sp/util/ProgressObserver.java
+++ b/org/gjt/sp/util/ProgressObserver.java
@@ -1,6 +1,6 @@
 /*
  * ProgressObserver.java - Progression monitor
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Matthieu Casanova
@@ -26,7 +26,7 @@ package org.gjt.sp.util;
  * Interface used to monitor things that can progress.
  *
  * @author Matthieu Casanova
- * @version $Id: ProgressObserver.java 12504 2008-04-22 23:12:43Z ezust $
+ * @version $Id: ProgressObserver.java 21831 2012-06-18 22:54:17Z ezust $
  * @since jEdit 4.3pre3
  */
 public interface ProgressObserver
diff --git a/org/gjt/sp/util/PropertiesBean.java b/org/gjt/sp/util/PropertiesBean.java
index 7c54e97..c9882ab 100644
--- a/org/gjt/sp/util/PropertiesBean.java
+++ b/org/gjt/sp/util/PropertiesBean.java
@@ -196,7 +196,7 @@ public abstract class PropertiesBean
 
 	private String encode(Object value)
 	{
-		Class _class = value.getClass();
+		Class<?> _class = value.getClass();
 		if (_class.isArray())
 		{
 			StringBuilder _val = new StringBuilder();
@@ -237,7 +237,7 @@ public abstract class PropertiesBean
 		if (_class.isArray())
 		{
 			StringTokenizer st = new StringTokenizer(value, String.valueOf(arraysep));
-			Class _type = _class.getComponentType();
+			Class<?> _type = _class.getComponentType();
 			_ret = Array.newInstance(_type, st.countTokens());
 			int _cnt = st.countTokens();
 			for (int i = 0; i < _cnt; i++)
diff --git a/org/gjt/sp/util/SegmentBuffer.java b/org/gjt/sp/util/SegmentBuffer.java
index bc75a0b..2ef7932 100644
--- a/org/gjt/sp/util/SegmentBuffer.java
+++ b/org/gjt/sp/util/SegmentBuffer.java
@@ -1,6 +1,6 @@
 /*
  * SegmentBuffer.java - A Segment you can append stuff to
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2001 Slava Pestov
diff --git a/org/gjt/sp/util/StandardUtilities.java b/org/gjt/sp/util/StandardUtilities.java
index 7fcd083..22994c2 100644
--- a/org/gjt/sp/util/StandardUtilities.java
+++ b/org/gjt/sp/util/StandardUtilities.java
@@ -1,6 +1,6 @@
 /*
  * StandardUtilities.java - Various miscallaneous utility functions
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2006 Matthieu Casanova, Slava Pestov
@@ -26,6 +26,7 @@ package org.gjt.sp.util;
 
 
 //{{{ Imports
+import javax.annotation.Nullable;
 import javax.swing.text.Segment;
 
 import java.security.MessageDigest;
@@ -39,7 +40,7 @@ import java.util.Stack;
  * Several tools that depends on JDK only.
  *
  * @author Matthieu Casanova
- * @version $Id: StandardUtilities.java 20108 2011-10-18 12:16:38Z evanpw $
+ * @version $Id: StandardUtilities.java 22936 2013-04-19 13:26:30Z kpouer $
  * @since 4.3pre5
  */
 public class StandardUtilities
@@ -476,6 +477,7 @@ loop:		for(int i = 0; i < str.length(); i++)
 		{
 		}
 
+		@Override
 		public int compare(E obj1, E obj2)
 		{
 			return compareStrings(obj1.toString(),
@@ -489,7 +491,7 @@ loop:		for(int i = 0; i < str.length(); i++)
 	 * as opposed to calling <code>o1.equals(o2)</code>.
 	 * @since jEdit 4.3pre6
 	 */
-	public static boolean objectsEqual(Object o1, Object o2)
+	public static boolean objectsEqual(@Nullable Object o1, @Nullable Object o2)
 	{
 		if(o1 == null)
 		{
@@ -735,18 +737,28 @@ loop:		for(int i = 0; i < str.length(); i++)
 	/**
 	 * Returns the md5sum for given string. Or dummy byte array on error
 	 * Suppress NoSuchAlgorithmException because MD5 algorithm always present in JRE
-	 * @param s Given string
+	 * @param charSequence Given string
 	 * @return md5 sum of given string
 	 */
-	public static byte[] md5(String s) {
-		final byte[] dummy = new byte[1];
-		try {
+	public static byte[] md5(CharSequence charSequence)
+	{
+		try
+		{
 			MessageDigest digest = MessageDigest.getInstance("MD5");
-			digest.update(s.getBytes());
+			byte[] ba = new byte[2];
+			for(int i = 0, n = charSequence.length(); i < n; i++)
+			{
+				char cp = charSequence.charAt(i);
+				ba[0] = (byte)(cp & 0xff);
+				ba[1] = (byte)(cp >> 8 & 0xff);
+				digest.update(ba);
+			}
 			return digest.digest();
-		} catch (NoSuchAlgorithmException e) {
+		}
+		catch (NoSuchAlgorithmException e)
+		{
 			Log.log(Log.ERROR, StandardUtilities.class, "Can't Calculate MD5 hash!", e);
-			return dummy;
+			return new byte[1];
 		}
 	}
 	// }}}
diff --git a/org/gjt/sp/util/StringList.java b/org/gjt/sp/util/StringList.java
index 797265b..c31cdf0 100644
--- a/org/gjt/sp/util/StringList.java
+++ b/org/gjt/sp/util/StringList.java
@@ -1,5 +1,5 @@
 /* {{{ StringList.java - a List of Strings with split() and join() methods
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Alan Ezust
diff --git a/org/gjt/sp/util/SyntaxUtilities.java b/org/gjt/sp/util/SyntaxUtilities.java
index 57ff206..df3f7f1 100644
--- a/org/gjt/sp/util/SyntaxUtilities.java
+++ b/org/gjt/sp/util/SyntaxUtilities.java
@@ -1,6 +1,6 @@
 /*
  * SyntaxUtilities.java - Syntax and styles utility utility functions
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2008 Matthieu Casanova, Slava Pestov
diff --git a/org/gjt/sp/util/Task.java b/org/gjt/sp/util/Task.java
index 2e98825..37ac167 100644
--- a/org/gjt/sp/util/Task.java
+++ b/org/gjt/sp/util/Task.java
@@ -1,6 +1,6 @@
 /*
  * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2010 Matthieu Casanova
@@ -40,9 +40,9 @@ public abstract class Task implements Runnable, ProgressObserver
 	 * The thread in which the task is running.
 	 * It is set automatically when the task starts.
 	 */
-	private Thread thread;
+	private volatile Thread thread;
 
-	private SwingWorker.StateValue state;
+	private volatile SwingWorker.StateValue state;
 
 	private volatile boolean cancellable = true;
 
@@ -149,7 +149,6 @@ public abstract class Task implements Runnable, ProgressObserver
 			thread.interrupt();
 	} //}}}
 
-
 	@Override
 	public String toString()
 	{
diff --git a/org/gjt/sp/util/TaskAdapter.java b/org/gjt/sp/util/TaskAdapter.java
index daf43fc..519a0b5 100644
--- a/org/gjt/sp/util/TaskAdapter.java
+++ b/org/gjt/sp/util/TaskAdapter.java
@@ -1,6 +1,6 @@
 /*
  * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright © 2011 Matthieu Casanova
diff --git a/org/gjt/sp/util/TaskListener.java b/org/gjt/sp/util/TaskListener.java
index 9fe6915..4fb9000 100644
--- a/org/gjt/sp/util/TaskListener.java
+++ b/org/gjt/sp/util/TaskListener.java
@@ -1,6 +1,6 @@
 /*
  * TaskListener
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2010 Matthieu Casanova
diff --git a/org/gjt/sp/util/TaskManager.java b/org/gjt/sp/util/TaskManager.java
index eb562e9..2e52570 100644
--- a/org/gjt/sp/util/TaskManager.java
+++ b/org/gjt/sp/util/TaskManager.java
@@ -1,6 +1,6 @@
 /*
  * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2010 jEdit contributors
@@ -25,6 +25,8 @@ import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
+import org.gjt.sp.jedit.bufferio.IoTask;
+
 /**
  * The TaskManager manage Tasks in the Threadpool, it knows all of them, and
  * sends events to TaskListeners.
@@ -33,16 +35,19 @@ import java.util.concurrent.CopyOnWriteArrayList;
  */
 public class TaskManager
 {
+	/** A singleton instance of TaskManager */
 	public static final TaskManager instance = new TaskManager();
 
 	private final List<TaskListener> listeners;
 
 	private final List<Task> tasks;
+	private final Object ioWaitLock;
 
 	private TaskManager()
 	{
 		listeners = new CopyOnWriteArrayList<TaskListener>();
 		tasks = Collections.synchronizedList(new ArrayList<Task>());
+		ioWaitLock = new Object();
 	}
 
 	/**
@@ -56,6 +61,23 @@ public class TaskManager
 		return tasks.size();
 	}
 
+	/**
+	 * Return the number of IO tasks in queue.
+	 *
+	 * @return the number of IO tasks in queue
+	 * @since jEdit 5.1pre1
+	 */
+	public int countIoTasks()
+	{
+		int size = 0;
+		synchronized (tasks) {
+			for(Task task : tasks)
+				if(task instanceof IoTask)
+					size++;
+		}
+		return size;
+	}
+
 	public void addTaskListener(TaskListener listener)
 	{
 		if (!listeners.contains(listener))
@@ -67,12 +89,15 @@ public class TaskManager
 	public void removeTaskListener(TaskListener listener)
 	{
 		if (listeners.contains(listener))
+		{
 			listeners.remove(listener);
+		}
 	}
 
 	void fireWaiting(Task task)
 	{
 		tasks.add(task);
+
 		List<TaskListener> listeners = this.listeners;
 		for (TaskListener listener : listeners)
 		{
@@ -92,11 +117,22 @@ public class TaskManager
 	void fireDone(Task task)
 	{
 		tasks.remove(task);
+
 		List<TaskListener> listeners = this.listeners;
 		for (TaskListener listener : listeners)
 		{
 			listener.done(task);
 		}
+
+		if(task instanceof IoTask)
+		{
+			AwtRunnableQueue.INSTANCE.queueAWTRunner(false);
+
+			synchronized (ioWaitLock)
+			{
+				ioWaitLock.notifyAll();
+			}
+		}
 	}
 
 	void fireStatusUpdated(Task task)
@@ -143,6 +179,43 @@ public class TaskManager
 		}
 	}
 
+	/** Wait for all IO tasks to finish
+	 * @since jEdit 5.1pre1
+	 */
+	public void waitForIoTasks()
+	{
+		synchronized (ioWaitLock)
+		{
+			while(countIoTasks() > 0)
+			{
+				try
+				{
+					ioWaitLock.wait();
+				} catch (InterruptedException e)
+				{
+					Log.log(Log.ERROR,this,e);
+				}
+			}
+		}
+
+		AwtRunnableQueue.INSTANCE.queueAWTRunner(true);
+	}
+
+	/** cancel a task by its class
+	 * @since jEdit 5.1pre1
+	 */
+	public void cancelTasksByClass(Class<? extends Task> clazz)
+	{
+		synchronized (tasks)
+		{
+			for(Task task: tasks)
+			{
+				if(task.getClass().equals(clazz))
+					task.cancel();
+			}
+		}
+	}
+
 	/**
 	 * Encapsulate a runnable into a task.
 	 * It is done by the Threadpool when receiving a simple Runnable
@@ -169,6 +242,16 @@ public class TaskManager
 			this.runnable = runnable;
 		}
 
+		public String getStatus()
+		{
+			return runnable.toString();
+		}
+
+		public String toString()
+		{
+			return runnable.toString();	
+		}
+
 		@Override
 		public void _run()
 		{
diff --git a/org/gjt/sp/util/ThreadAbortMonitor.java b/org/gjt/sp/util/ThreadAbortMonitor.java
index 9581963..3449d0e 100644
--- a/org/gjt/sp/util/ThreadAbortMonitor.java
+++ b/org/gjt/sp/util/ThreadAbortMonitor.java
@@ -1,6 +1,6 @@
 /*
  * ThreadAbortMonitor.java - Thread Abort Monitor
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2006 Matthieu Casanova
diff --git a/org/gjt/sp/util/ThreadUtilities.java b/org/gjt/sp/util/ThreadUtilities.java
index 85c44d0..5f94e4c 100644
--- a/org/gjt/sp/util/ThreadUtilities.java
+++ b/org/gjt/sp/util/ThreadUtilities.java
@@ -1,243 +1,249 @@
-/*
- * ThreadUtilities.java - Utilities for threading
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 Matthieu Casanova
- * Portions Copyright (C) 2010 Marcelo Vanzin
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.util;
-
-//{{{ Imports
-import java.awt.EventQueue;
-import java.lang.reflect.InvocationTargetException;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.atomic.AtomicInteger;
-//}}}
-
-/**
- * The threadpool of jEdit.
- * It uses a ExecutorService from the java.util.concurrent package.
- * You can run {@link Task} or {@link Runnable} in it, Runnables will be
- * encapsulated in Task.
- *
- * @author Matthieu Casanova
- * @author Marcelo Vanzin
- * @since jEdit 4.4pre1
- */
-public class ThreadUtilities
-{
-	//{{{ runInDispatchThread() method
-	/**
-	 * Run the runnable in EventDispatch Thread.
-	 * If the current thread is EventDispatch, it will run
-	 * immediately otherwise it will be queued in the DispatchThread
-	 * The difference with VFSManager.runInAWTThread() method is that
-	 * this one will not wait for IO Request before being executed
-	 *
-	 * @param runnable the runnable to run
-	 */
-	public static void runInDispatchThread(Runnable runnable)
-	{
-		if (EventQueue.isDispatchThread())
-			runnable.run();
-		else
-			EventQueue.invokeLater(runnable);
-	} //}}}
-
-	//{{{ runInDispatchThreadAndWait() method
-	/** Runs the runnable in EDT through <code>invokeLater</code>,
-	 *  but returns only after the runnable is executed.
-	 *  This method is uninterruptible.
-	 *  <p>Note the difference from <code>invokeAndWait</code>.
-	 *  If current thread is not EDT and there are runnables
-	 *  queued in EDT:
-	 *  <ul><li>this method runs the runnable after them</li>
-	 *  <li><code>invokeAndWait</code> runs the runnable before them
-	 *  </li></ul>
-	 */
-	public static void runInDispatchThreadAndWait(Runnable runnable)
-	{
-		boolean interrupted = false;
-		MyRunnable run = new MyRunnable(runnable);
-		runInDispatchThread(run);
-		while (run.done.getCount() > 0)
-		{
-			try
-			{
-				run.done.await();
-			}
-			catch (InterruptedException e)
-			{
-				interrupted = true;
-			}
-		}
-		if (interrupted)
-			Thread.currentThread().interrupt();
-	} //}}}
-
-	//{{{ runInDispatchThreadNow() method
-	/**
-	 * Runs the runnable in EDT through <code>invokeAndWait</code>.
-	 * Even if the thread gets interrupted, the call does not return
-	 * until the runnable finishes (uninterruptible method).
-	 * <p>
-	 * This method uses <code>EventQueue.invokeAndWait</code>, so
-	 * the following remark applies:
-	 * <p>If you use invokeAndWait(), make sure that the thread that calls
-	 * invokeAndWait() does not hold any locks that other threads might
-	 * need while the call is occurring.
-	 * From the article:
-	 * <a href="http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html#event_dispatching">
-	 * Threads and Swing</a>
-	 */
-	public static void runInDispatchThreadNow(Runnable runnable)
-	{
-		boolean interrupted = false;
-		MyRunnable run = new MyRunnable(runnable);
-		try
-		{
-			EventQueue.invokeAndWait(run);
-		}
-		catch (InterruptedException e)
-		{
-			interrupted = true;
-		}
-		catch (InvocationTargetException ite)
-		{
-			Throwable cause = ite.getCause();
-			if (cause instanceof RuntimeException)
-				throw (RuntimeException)cause;
-			else
-			{
-				Log.log(Log.ERROR, ThreadUtilities.class,
-					"Invocation Target Exception:");
-				Log.log(Log.ERROR, runnable.getClass(),
-					cause);
-			}
-		}
-		while (run.done.getCount() > 0)
-		{
-			try
-			{
-				run.done.await();
-			}
-			catch (InterruptedException e)
-			{
-				interrupted = true;
-			}
-		}
-		if (interrupted)
-			Thread.currentThread().interrupt();
-	} //}}}
-
-	//{{{ runInBackground() method
-	/**
-	 * Run the runnable in the threadpool.
-	 * The runnable will be encapsulated in a {@link Task}
-	 * @see #runInBackground(Task)
-	 *
-	 * @param runnable the runnable to run
-	 */
-	public static void runInBackground(Runnable runnable)
-	{
-		Task task;
-		if (runnable instanceof Task)
-		{
-			task = (Task) runnable;
-		}
-		else
-		{
-			task = TaskManager.decorate(runnable);
-		}
-		TaskManager.instance.fireWaiting(task);
-		threadPool.execute(task);
-	}
-
-	/**
-	 * Run the task in the threadpool.
-	 * The runnable will be encapsulated in a {@link Task}
-	 *
-	 * @param task the task to run
-	 */
-	public static void runInBackground(Task task)
-	{
-		TaskManager.instance.fireWaiting(task);
-		threadPool.execute(task);
-	} //}}}
-
-	private ThreadUtilities()
-	{
-	}
-
-	//{{{ JEditThreadFactory class
-	private static class JEditThreadFactory implements ThreadFactory
-	{
-		private JEditThreadFactory()
-		{
-			threadIDs = new AtomicInteger(0);
-			threadGroup = new ThreadGroup("jEdit Workers");
-		}
-
-		@Override
-		public Thread newThread(Runnable r)
-		{
-			Thread t = new Thread(threadGroup, r);
-			t.setName("jEdit Worker #" +threadIDs.getAndIncrement());
-			return t;
-		}
-
-		private final AtomicInteger threadIDs;
-		private final ThreadGroup threadGroup;
-	} //}}}
-
-
-	private static final ExecutorService threadPool;
-
-	private static final int CORE_POOL_SIZE = 4;
-
-	static
-	{
-		threadPool = Executors.newCachedThreadPool(new JEditThreadFactory());
-		((ThreadPoolExecutor) threadPool).setCorePoolSize(CORE_POOL_SIZE);
-	}
-
-	//{{{ MyRunnable class
-	private static class MyRunnable implements Runnable
-	{
-		private final Runnable runnable;
-
-		private CountDownLatch done = new CountDownLatch(1);
-
-		private MyRunnable(Runnable runnable)
-		{
-			this.runnable = runnable;
-		}
-
-		@Override
-		public void run()
-		{
-			runnable.run();
-			done.countDown();
-		}
-	} //}}}
-
-}
+/*
+ * ThreadUtilities.java - Utilities for threading
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright (C) 2010 Matthieu Casanova
+ * Portions Copyright (C) 2010 Marcelo Vanzin
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package org.gjt.sp.util;
+
+//{{{ Imports
+import java.awt.EventQueue;
+import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.atomic.AtomicInteger;
+//}}}
+
+/**
+ * The threadpool of jEdit.
+ * It uses a ExecutorService from the java.util.concurrent package.
+ * You can run {@link Task} or {@link Runnable} in it, Runnables will be
+ * encapsulated in Task and displayed in the Task Monitor. 
+ *
+ * @author Matthieu Casanova
+ * @author Marcelo Vanzin
+ * @since jEdit 4.4pre1
+ */
+public class ThreadUtilities
+{
+	//{{{ runInDispatchThread() method
+	/**
+	 * Run the runnable in EventDispatch Thread.
+	 * If the current thread is EventDispatch, it will run
+	 * immediately otherwise it will be queued in the DispatchThread
+	 * The difference with VFSManager.runInAWTThread() method is that
+	 * this one will not wait for IO Request before being executed
+	 *
+	 * @param runnable the runnable to run - it should return something meaningful from 
+	 *    toString() so that we can display it in the Task Monitor.
+	 */
+	public static void runInDispatchThread(Runnable runnable)
+	{
+		if (EventQueue.isDispatchThread())
+			runnable.run();
+		else
+			EventQueue.invokeLater(runnable);
+	} //}}}
+
+	//{{{ runInDispatchThreadAndWait() method
+	/** Runs the runnable in EDT through <code>invokeLater</code>,
+	 *  but returns only after the runnable is executed.
+	 *  This method is uninterruptible.
+	 *  <p>Note the difference from <code>invokeAndWait</code>.
+	 *  If current thread is not EDT and there are runnables
+	 *  queued in EDT:
+	 *  <ul><li>this method runs the runnable after them</li>
+	 *  <li><code>invokeAndWait</code> runs the runnable before them
+	 *  </li></ul>
+	 * @param runnable the runnable to run - it should return something meaningful from 
+	 *    toString() so that we can display it in the Task Monitor.
+	 */
+	public static void runInDispatchThreadAndWait(Runnable runnable)
+	{
+		boolean interrupted = false;
+		CountDownLatchRunnable run = new CountDownLatchRunnable(runnable);
+		runInDispatchThread(run);
+		while (run.done.getCount() > 0)
+		{
+			try
+			{
+				run.done.await();
+			}
+			catch (InterruptedException e)
+			{
+				interrupted = true;
+			}
+		}
+		if (interrupted)
+			Thread.currentThread().interrupt();
+	} //}}}
+
+	//{{{ runInDispatchThreadNow() method
+	/**
+	 * Runs the runnable in EDT through <code>invokeAndWait</code>.
+	 * Even if the thread gets interrupted, the call does not return
+	 * until the runnable finishes (uninterruptible method).
+	 * <p>
+	 * This method uses <code>EventQueue.invokeAndWait</code>, so
+	 * the following remark applies:
+	 * <p>If you use invokeAndWait(), make sure that the thread that calls
+	 * invokeAndWait() does not hold any locks that other threads might
+	 * need while the call is occurring.
+	 * From the article:
+	 * <a href="http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html#event_dispatching">
+	 * Threads and Swing</a>
+	 * @param runnable the runnable to run - it should return something meaningful from 
+	 *    toString() so that we can display it in the Task Monitor.
+	 */
+	public static void runInDispatchThreadNow(Runnable runnable)
+	{
+		boolean interrupted = false;
+		CountDownLatchRunnable run = new CountDownLatchRunnable(runnable);
+		try
+		{
+			EventQueue.invokeAndWait(run);
+		}
+		catch (InterruptedException e)
+		{
+			interrupted = true;
+		}
+		catch (InvocationTargetException ite)
+		{
+			Throwable cause = ite.getCause();
+			if (cause instanceof RuntimeException)
+				throw (RuntimeException)cause;
+			else
+			{
+				Log.log(Log.ERROR, ThreadUtilities.class,
+					"Invocation Target Exception:");
+				Log.log(Log.ERROR, runnable.getClass(),
+					cause);
+			}
+		}
+		while (run.done.getCount() > 0)
+		{
+			try
+			{
+				run.done.await();
+			}
+			catch (InterruptedException e)
+			{
+				interrupted = true;
+			}
+		}
+		if (interrupted)
+			Thread.currentThread().interrupt();
+	} //}}}
+
+	//{{{ runInBackground() method
+	/**
+	 * Run the runnable in the threadpool.
+	 * The runnable will be encapsulated in a {@link Task}
+	 * @see #runInBackground(Task)
+	 *
+	 * @param runnable the runnable to run - it should return something meaningful from 
+	     toString() so that we can display it in the Task Monitor.
+	 */
+	public static void runInBackground(Runnable runnable)
+	{
+		Task task;
+		if (runnable instanceof Task)
+		{
+			task = (Task) runnable;
+		}
+		else
+		{
+			task = TaskManager.decorate(runnable);
+		}
+		TaskManager.instance.fireWaiting(task);
+		threadPool.execute(task);
+	}
+
+	/**
+	 * Run the task in the threadpool.
+	 * The runnable will be encapsulated in a {@link Task}
+	 *
+	 * @param task the task to run
+	 */
+	public static void runInBackground(Task task)
+	{
+		TaskManager.instance.fireWaiting(task);
+		threadPool.execute(task);
+	} //}}}
+
+	private ThreadUtilities()
+	{
+	}
+
+	//{{{ JEditThreadFactory class
+	private static class JEditThreadFactory implements ThreadFactory
+	{
+		private JEditThreadFactory()
+		{
+			threadIDs = new AtomicInteger(0);
+			threadGroup = new ThreadGroup("jEdit Workers");
+		}
+
+		@Override
+		public Thread newThread(Runnable r)
+		{
+			Thread t = new Thread(threadGroup, r);
+			t.setName("jEdit Worker #" + threadIDs.getAndIncrement());
+			return t;
+		}
+
+		private final AtomicInteger threadIDs;
+		private final ThreadGroup threadGroup;
+	} //}}}
+
+
+	private static final ExecutorService threadPool;
+
+	private static final int CORE_POOL_SIZE = 4;
+
+	static
+	{
+		threadPool = Executors.newCachedThreadPool(new JEditThreadFactory());
+		((ThreadPoolExecutor) threadPool).setCorePoolSize(CORE_POOL_SIZE);
+	}
+
+	//{{{ MyRunnable class
+	private static class CountDownLatchRunnable implements Runnable
+	{
+		private final Runnable runnable;
+
+		private CountDownLatch done = new CountDownLatch(1);
+
+		private CountDownLatchRunnable(Runnable runnable)
+		{
+			this.runnable = runnable;
+		}
+
+		@Override
+		public void run()
+		{
+			runnable.run();
+			done.countDown();
+		}
+	} //}}}
+
+}
diff --git a/org/gjt/sp/util/WorkRequest.java b/org/gjt/sp/util/WorkRequest.java
deleted file mode 100644
index fc9b3c2..0000000
--- a/org/gjt/sp/util/WorkRequest.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * WorkRequest.java - Runnable subclass
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2000 Slava Pestov
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.util;
-
-/**
- * A subclass of the Runnable interface.
- * @since jEdit 2.6pre1
- * @deprecated
- * @see org.gjt.sp.util.Task
- * @version $Id: WorkRequest.java 19046 2010-11-28 02:26:21Z ezust $
- */
- at Deprecated
-public abstract class WorkRequest implements Runnable, ProgressObserver
-{
-	/**
-	 * If the max value is greater that <code>Integer.MAX_VALUE</code> this 
-	 * will be true and all values will be divided by 1024.
-	 * @since jEdit 4.3pre3
-	 */
-	private boolean largeValues;
-
-	/**
-	 * Sets if the request can be aborted.
-	 */
-	public void setAbortable(boolean abortable)
-	{
-		Thread thread = Thread.currentThread();
-		if(thread instanceof WorkThread)
-			((WorkThread)thread).setAbortable(abortable);
-	}
-
-	/**
-	 * Sets the status text.
-	 * @param status The status text
-	 */
-	public void setStatus(String status)
-	{
-		Thread thread = Thread.currentThread();
-		if(thread instanceof WorkThread)
-			((WorkThread)thread).setStatus(status);
-	}
-
-	/**
-	 * Sets the progress value.
-	 * @param value The progress value.
-	 * @deprecated use {@link #setValue(long)}
-	 */
-	@Deprecated
-	public void setProgressValue(int value)
-	{
-		Thread thread = Thread.currentThread();
-		if(thread instanceof WorkThread)
-			((WorkThread)thread).setProgressValue(value);
-	}
-
-	/**
-	 * Sets the maximum progress value.
-	 * @param value The progress value.
-	 * @deprecated use {@link #setMaximum(long)}
-	 */
-	@Deprecated
-	public void setProgressMaximum(int value)
-	{
-		Thread thread = Thread.currentThread();
-		if(thread instanceof WorkThread)
-			((WorkThread)thread).setProgressMaximum(value);
-	}
-
-	//{{{ setValue() method
-	/**
-	 * Update the progress value.
-	 *
-	 * @param value the new value
-	 * @since jEdit 4.3pre3
-	 */
-	public void setValue(long value)
-	{
-		Thread thread = Thread.currentThread();
-		if(thread instanceof WorkThread)
-		{
-			if (largeValues)
-			{
-				((WorkThread)thread).setProgressValue((int) (value >> 10));
-			}
-			else
-			{
-				((WorkThread)thread).setProgressValue((int) value);
-			}
-		}
-	} //}}}
-
-	//{{{ setValue() method
-	/**
-	 * Update the maximum value.
-	 *
-	 * @param value the new maximum value
-	 * @since jEdit 4.3pre3
-	 */
-	public void setMaximum(long value)
-	{
-		Thread thread = Thread.currentThread();
-		if(thread instanceof WorkThread)
-		{
-			if (value > Integer.MAX_VALUE)
-			{
-				largeValues = true;
-				((WorkThread)thread).setProgressMaximum((int) (value >> 10));
-			}
-			else
-			{
-				largeValues = false;
-				((WorkThread)thread).setProgressMaximum((int) value);
-			}
-		}
-	} //}}}
-}
diff --git a/org/gjt/sp/util/WorkThread.java b/org/gjt/sp/util/WorkThread.java
deleted file mode 100644
index 2299751..0000000
--- a/org/gjt/sp/util/WorkThread.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * WorkThread.java - Background thread that does stuff
- * Copyright (C) 2000 Slava Pestov
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.util;
-
-/**
- * Services work requests in the background.
- * @author Slava Pestov
- * @deprecated
- * @see org.gjt.sp.util.ThreadUtilities
- * @version $Id: WorkThread.java 18300 2010-08-05 13:14:02Z kpouer $
- */
- at Deprecated
-public class WorkThread extends Thread implements ThreadAbortMonitor
-{
-	public WorkThread(WorkThreadPool pool, ThreadGroup group, String name)
-	{
-		super(group, name);
-		// so that jEdit doesn't exit with no views open automatically
-		//setDaemon(true);
-		setPriority(Thread.MIN_PRIORITY);
-
-		this.pool = pool;
-	}
-
-	/**
-	 * Sets if the current request can be aborted.
-	 * If set to true and already aborted, the thread will be stopped
-	 *
-	 * @param abortable true if the WorkThread is abortable
-	 * @since jEdit 2.6pre1
-	 */
-	public void setAbortable(boolean abortable)
-	{
-		synchronized(abortLock)
-		{
-			this.abortable = abortable;
-			if(aborted)
-				stop(new Abort());
-		}
-	}
-
-	/**
-	 * Returns if the work thread is currently running a request.
-	 * @return true if a request is currently running
-	 */
-	public boolean isRequestRunning()
-	{
-		return requestRunning;
-	}
-
-
-	public boolean isAborted()
-	{
-		synchronized (abortLock)
-		{
-			return aborted;
-		}
-	}
-
-	/**
-	 * Returns the status text.
-	 * @return the status label
-	 */
-	public String getStatus()
-	{
-		return status;
-	}
-
-	/**
-	 * Sets the status text.
-	 * @param status the new status of the thread
-	 * @since jEdit 2.6pre1
-	 */
-	public void setStatus(String status)
-	{
-		this.status = status;
-		pool.fireProgressChanged(this);
-	}
-
-	/**
-	 * Returns the progress value.
-	 * @return the progress value
-	 */
-	public int getProgressValue()
-	{
-		return progressValue;
-	}
-
-	/**
-	 * Sets the progress value.
-	 * @param progressValue the new progress value
-	 * @since jEdit 2.6pre1
-	 */
-	public void setProgressValue(int progressValue)
-	{
-		this.progressValue = progressValue;
-		pool.fireProgressChanged(this);
-	}
-
-	/**
-	 * Returns the progress maximum.
-	 * @return the maximum value of the progression
-	 */
-	public int getProgressMaximum()
-	{
-		return progressMaximum;
-	}
-
-	/**
-	 * Sets the maximum progress value.
-	 * @param progressMaximum the maximum value of the progression
-	 * @since jEdit 2.6pre1
-	 */
-	public void setProgressMaximum(int progressMaximum)
-	{
-		this.progressMaximum = progressMaximum;
-		pool.fireProgressChanged(this);
-	}
-
-	/**
-	 * Aborts the currently running request, if allowed.
-	 * @since jEdit 2.6pre1
-	 */
-	public void abortCurrentRequest()
-	{
-		synchronized(abortLock)
-		{
-			if(abortable && !aborted)
-				stop(new Abort());
-			aborted = true;
-		}
-	}
-
-	public void run()
-	{
-		Log.log(Log.DEBUG,this,"Work request thread starting [" + getName() + "]");
-
-		for(;;)
-		{
-			doRequests();
-		}
-	}
-
-	// private members
-	private WorkThreadPool pool;
-	private final Object abortLock = new Object();
-	private boolean requestRunning;
-	private boolean abortable;
-	private boolean aborted;
-	private String status;
-	private int progressValue;
-	private int progressMaximum;
-
-	private void doRequests()
-	{
-		WorkThreadPool.Request request;
-		for(;;)
-		{
-			request = pool.getNextRequest();
-			if(request == null)
-				break;
-			else
-			{
-				requestRunning = true;
-				pool.fireStatusChanged(this);
-				doRequest(request);
-				requestRunning = false;
-			}
-		}
-
-		pool.fireStatusChanged(this);
-
-		synchronized(pool.waitForAllLock)
-		{
-			// notify a running waitForRequests() method
-			pool.waitForAllLock.notifyAll();
-		}
-
-		synchronized(pool.lock)
-		{
-			// wait for more requests
-			try
-			{
-				pool.lock.wait();
-			}
-			catch(InterruptedException ie)
-			{
-				Log.log(Log.ERROR,this,ie);
-			}
-		}
-	}
-
-	private void doRequest(WorkThreadPool.Request request)
-	{
-		Log.log(Log.DEBUG,WorkThread.class,"Running in work thread: " + request);
-
-		try
-		{
-			request.run.run();
-		}
-		catch(Abort a)
-		{
-			Log.log(Log.ERROR,WorkThread.class,"Unhandled abort", a);
-		}
-		catch(Throwable t)
-		{
-			Log.log(Log.ERROR,WorkThread.class,"Exception in work thread: ", t);
-		}
-		finally
-		{
-			synchronized(abortLock)
-			{
-				aborted = abortable = false;
-			}
-			status = null;
-			progressValue = progressMaximum = 0;
-			pool.requestDone();
-			pool.fireStatusChanged(this);
-		}
-	}
-
-	public static class Abort extends Error
-	{
-		public Abort()
-		{
-			super("Work request aborted");
-		}
-	}
-}
diff --git a/org/gjt/sp/util/WorkThreadPool.java b/org/gjt/sp/util/WorkThreadPool.java
deleted file mode 100644
index 0fd433a..0000000
--- a/org/gjt/sp/util/WorkThreadPool.java
+++ /dev/null
@@ -1,488 +0,0 @@
-/*
- * WorkThreadPool.java - Background thread pool that does stuff
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2000 Slava Pestov
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.util;
-
-//{{{ Imports
-import javax.swing.event.EventListenerList;
-import java.awt.EventQueue;
-//}}}
-
-/**
- * A pool of work threads.
- * @author Slava Pestov
- * @version $Id: WorkThreadPool.java 22134 2012-09-02 02:22:53Z ezust $
- * @deprecated
- * @see org.gjt.sp.util.ThreadUtilities
- * @since jEdit 2.6pre1
- */
- at Deprecated
-public class WorkThreadPool
-{
-	//{{{ WorkThreadPool constructor
-	/**
-	 * Creates a new work thread pool with the specified number of
-	 * work threads.
-	 * @param name The thread name prefix
-	 * @param count The number of work threads
-	 */
-	public WorkThreadPool(String name, int count)
-	{
-		listenerList = new EventListenerList();
-
-		if(count != 0)
-		{
-			threadGroup = new ThreadGroup(name);
-			threads = new WorkThread[count];
-			for(int i = 0; i < threads.length; i++)
-			{
-				threads[i] = new WorkThread(this,threadGroup,name + " #" + (i+1));
-			}
-		}
-		else
-			Log.log(Log.WARNING,this,"Async I/O disabled");
-	} //}}}
-
-	//{{{ start() method
-	/**
-	 * Starts all the threads in this thread pool.
-	 */
-	public void start()
-	{
-		/* not really needed since threads don't start until after */
-		synchronized(lock)
-		{
-			started = true;
-
-			if(awtRequestCount != 0 && requestCount == 0)
-				queueAWTRunner();
-		}
-
-		if(threads != null)
-		{
-			for(int i = 0; i < threads.length; i++)
-			{
-				threads[i].start();
-			}
-		}
-	} //}}}
-
-	//{{{ addWorkRequest() method
-	/**
-	 * Adds a work request to the queue. Only in one case the
-	 * <code>Runnable</code> is executed directly: if <code>inAWT</code>
-	 * is <code>true</code> and the queue is empty
-	 * at the moment of call.
-	 * @param run The runnable
-	 * @param inAWT If true, will be executed in AWT thread. Otherwise,
-	 * will be executed in work thread.
-	 */
-	public void addWorkRequest(Runnable run, boolean inAWT)
-	{
-		if(threads == null)
-		{
-			run.run();
-			return;
-		}
-
-		synchronized(lock)
-		{
-			//{{{ if there are no requests, execute AWT requests immediately
-			if(started && inAWT && requestCount == 0 && awtRequestCount == 0)
-			{
-//				Log.log(Log.DEBUG,this,"AWT immediate: " + run);
-
-				ThreadUtilities.runInDispatchThread(run);
-				return;
-			} //}}}
-
-			Request request = new Request(run);
-
-			//{{{ Add to AWT queue...
-			if(inAWT)
-			{
-				if(firstAWTRequest == null && lastAWTRequest == null)
-					firstAWTRequest = lastAWTRequest = request;
-				else
-				{
-					lastAWTRequest.next = request;
-					lastAWTRequest = request;
-				}
-
-				awtRequestCount++;
-
-				// if no requests are running, requestDone()
-				// will not be called, so we must queue the
-				// AWT runner ourselves.
-				if(started && requestCount == 0)
-					queueAWTRunner();
-			} //}}}
-			//{{{ Add to work thread queue...
-			else
-			{
-				if(firstRequest == null && lastRequest == null)
-					firstRequest = lastRequest = request;
-				else
-				{
-					lastRequest.next = request;
-					lastRequest = request;
-				}
-
-				requestCount++;
-			} //}}}
-
-			lock.notifyAll();
-		}
-	} //}}}
-
-	//{{{ waitForRequests() method
-	/**
-	 * Waits until all requests are complete.
-	 */
-	public void waitForRequests()
-	{
-		if(threads == null)
-			return;
-
-		synchronized(waitForAllLock)
-		{
-			while(requestCount != 0)
-			{
-				try
-				{
-					waitForAllLock.wait();
-				}
-				catch(InterruptedException ie)
-				{
-					Log.log(Log.ERROR,this,ie);
-				}
-			}
-		}
-
-		if(EventQueue.isDispatchThread())
-		{
-			// do any queued AWT runnables
-			doAWTRequests();
-		}
-		else
-		{
-			try
-			{
-				EventQueue.invokeAndWait(new RunRequestsInAWTThread());
-			}
-			catch(Exception e)
-			{
-				Log.log(Log.ERROR,this,e);
-			}
-		}
-	} //}}}
-
-	//{{{ getRequestCount() method
-	/**
-	 * Returns the number of pending requests.
-	 * @return the pending request count
-	 */
-	public int getRequestCount()
-	{
-		return requestCount;
-	} //}}}
-
-	//{{{ getThreadCount() method
-	/**
-	 * Returns the number of threads in this pool.
-	 * @return the thread count
-	 */
-	public int getThreadCount()
-	{
-		if(threads == null)
-			return 0;
-		else
-			return threads.length;
-	} //}}}
-
-	//{{{ getThread() method
-	/**
-	 * Returns the specified thread.
-	 * @param index The index of the thread
-	 * @return a WorkThread
-	 */
-	public WorkThread getThread(int index)
-	{
-		return threads[index];
-	} //}}}
-
-	//{{{ addProgressListener() method
-	/**
-	 * Adds a progress listener to this thread pool.
-	 * @param listener The listener
-	 */
-	public void addProgressListener(WorkThreadProgressListener listener)
-	{
-		listenerList.add(WorkThreadProgressListener.class,listener);
-	} //}}}
-
-	//{{{ removeProgressListener() method
-	/**
-	 * Removes a progress listener from this thread pool.
-	 * @param listener The listener
-	 */
-	public void removeProgressListener(WorkThreadProgressListener listener)
-	{
-		listenerList.remove(WorkThreadProgressListener.class,listener);
-	} //}}}
-
-	//{{{ Package-private members
-	final Object lock = new Object();
-	final Object waitForAllLock = new Object();
-
-	//{{{ fireStatusChanged() method
-	void fireStatusChanged(WorkThread thread)
-	{
-		final Object[] listeners = listenerList.getListenerList();
-		if(listeners.length != 0)
-		{
-			int index = 0;
-			for(int i = 0; i < threads.length; i++)
-			{
-				if(threads[i] == thread)
-				{
-					index = i;
-					break;
-				}
-			}
-
-			for(int i = listeners.length - 2; i >= 0; i--)
-			{
-				if(listeners[i] == WorkThreadProgressListener.class)
-				{
-					((WorkThreadProgressListener)listeners[i+1])
-						.statusUpdate(WorkThreadPool.this,index);
-				}
-			}
-		}
-	} //}}}
-
-	//{{{ fireProgressChanged() method
-	void fireProgressChanged(WorkThread thread)
-	{
-		final Object[] listeners = listenerList.getListenerList();
-		if(listeners.length != 0)
-		{
-			int index = 0;
-			for(int i = 0; i < threads.length; i++)
-			{
-				if(threads[i] == thread)
-				{
-					index = i;
-					break;
-				}
-			}
-
-			for(int i = listeners.length - 2; i >= 0; i--)
-			{
-				if(listeners[i] == WorkThreadProgressListener.class)
-				{
-					((WorkThreadProgressListener)listeners[i+1])
-						.progressUpdate(WorkThreadPool.this,index);
-				}
-			}
-		}
-	} //}}}
-
-	//{{{ requestDone() method
-	void requestDone()
-	{
-		synchronized(lock)
-		{
-			requestCount--;
-
-			if(requestCount == 0 && firstAWTRequest != null)
-				queueAWTRunner();
-		}
-	} //}}}
-
-	//{{{ getNextRequest() method
-	Request getNextRequest()
-	{
-		synchronized(lock)
-		{
-			Request request = firstRequest;
-			if(request == null)
-				return null;
-
-			firstRequest = firstRequest.next;
-			if(firstRequest == null)
-				lastRequest = null;
-
-			if(request.alreadyRun)
-				throw new InternalError("AIEE!!! Request run twice!!! " + request.run);
-			request.alreadyRun = true;
-
-			/* StringBuffer buf = new StringBuffer("request queue is now: ");
-			Request _request = request.next;
-			while(_request != null)
-			{
-				buf.append(_request.id);
-				if(_request.next != null)
-					buf.append(",");
-				_request = _request.next;
-			}
-			Log.log(Log.DEBUG,this,buf.toString()); */
-
-			return request;
-		}
-	} //}}}
-
-	//}}}
-
-	//{{{ Private members
-
-	//{{{ Instance variables
-	private boolean started;
-	private ThreadGroup threadGroup;
-	private WorkThread[] threads;
-
-	// Request queue
-	private Request firstRequest;
-	private Request lastRequest;
-	private int requestCount;
-
-	// AWT thread magic
-	private boolean awtRunnerQueued;
-	private Request firstAWTRequest;
-	private Request lastAWTRequest;
-	private int awtRequestCount;
-
-	private final EventListenerList listenerList;
-	//}}}
-
-	//{{{ doAWTRequests() method
-	/** Must always be called with the lock held. */
-	private void doAWTRequests()
-	{
-		while(requestCount == 0 && firstAWTRequest != null)
-		{
-			doAWTRequest(getNextAWTRequest());
-		}
-	} //}}}
-
-	//{{{ doAWTRequest() method
-	/**
-	 * Must always be called with the lock held.
-	 * @param request the request to run
-	 */
-	private void doAWTRequest(Request request)
-	{
-//		Log.log(Log.DEBUG,this,"Running in AWT thread: " + request);
-
-		try
-		{
-			request.run.run();
-		}
-		catch(Throwable t)
-		{
-			Log.log(Log.ERROR,WorkThread.class,"Exception "
-				+ "in AWT thread:");
-			Log.log(Log.ERROR,WorkThread.class,t);
-		}
-
-		awtRequestCount--;
-	} //}}}
-
-	//{{{ queueAWTRunner() method
-	/** Must always be called with the lock held. */
-	private void queueAWTRunner()
-	{
-		if(!awtRunnerQueued)
-		{
-			awtRunnerQueued = true;
-			EventQueue.invokeLater(new RunRequestsInAWTThread());
-//			Log.log(Log.DEBUG,this,"AWT runner queued");
-		}
-	} //}}}
-
-	//{{{ getNextAWTRequest() method
-	private Request getNextAWTRequest()
-	{
-		Request request = firstAWTRequest;
-		firstAWTRequest = firstAWTRequest.next;
-		if(firstAWTRequest == null)
-			lastAWTRequest = null;
-
-		if(request.alreadyRun)
-			throw new InternalError("AIEE!!! Request run twice!!! " + request.run);
-		request.alreadyRun = true;
-
-		/* StringBuffer buf = new StringBuffer("AWT request queue is now: ");
-		Request _request = request.next;
-		while(_request != null)
-		{
-			buf.append(_request.id);
-			if(_request.next != null)
-				buf.append(",");
-			_request = _request.next;
-		}
-		Log.log(Log.DEBUG,this,buf.toString()); */
-
-		return request;
-	} //}}}
-
-	//}}}
-
-	static int ID;
-
-	//{{{ Request class
-	static class Request
-	{
-		int id = ++ID;
-
-		Runnable run;
-
-		boolean alreadyRun;
-
-		Request next;
-
-		Request(Runnable run)
-		{
-			this.run = run;
-		}
-
-		public String toString()
-		{
-			return "[id=" + id + ",run=" + run + ']';
-		}
-	} //}}}
-
-	//{{{ RunRequestsInAWTThread class
-	class RunRequestsInAWTThread implements Runnable
-	{
-		public void run()
-		{
-			synchronized(lock)
-			{
-				awtRunnerQueued = false;
-				if(requestCount == 0)
-					doAWTRequests();
-			}
-		}
-	} //}}}
-}
diff --git a/org/gjt/sp/util/WorkThreadProgressListener.java b/org/gjt/sp/util/WorkThreadProgressListener.java
deleted file mode 100644
index 13b1297..0000000
--- a/org/gjt/sp/util/WorkThreadProgressListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * WorkThreadProgressListener.java - Progress listener
- * Copyright (C) 2000 Slava Pestov
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.gjt.sp.util;
-
-import java.util.EventListener;
-
-/**
- * A work thread execution progress listener.
- * @since jEdit 2.6pre1
- */
-public interface WorkThreadProgressListener extends EventListener
-{
-	// status message changed, operation started, operation ends, ...
-	void statusUpdate(WorkThreadPool threadPool, int threadIndex);
-
-	// progress bar value change
-	void progressUpdate(WorkThreadPool threadPool, int threadIndex);
-}
diff --git a/org/gjt/sp/util/XMLUtilities.java b/org/gjt/sp/util/XMLUtilities.java
index 2cbe816..376535d 100644
--- a/org/gjt/sp/util/XMLUtilities.java
+++ b/org/gjt/sp/util/XMLUtilities.java
@@ -1,6 +1,6 @@
 /*
  * StandardUtilities.java - Miscelaneous XML utility functions.
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 1999, 2006 Marcelo Vanzin, Slava Pestov
@@ -25,6 +25,7 @@
 package org.gjt.sp.util;
 
 //{{{ Imports
+import java.io.Closeable;
 import java.io.InputStream;
 import java.io.BufferedInputStream;
 import java.io.IOException;
@@ -41,7 +42,7 @@ import org.xml.sax.helpers.XMLReaderFactory;
  * XML utility methods that only depend on the JDK.
  *
  * @author Marcelo Vanzin
- * @version $Id: XMLUtilities.java 19899 2011-09-02 07:36:54Z kpouer $
+ * @version $Id: XMLUtilities.java 22883 2013-03-23 17:58:56Z thomasmey $
  * @since 4.3pre6
  */
 public class XMLUtilities
@@ -152,7 +153,7 @@ public class XMLUtilities
 		}
 		finally
 		{
-			IOUtilities.closeQuietly(in);
+			IOUtilities.closeQuietly((Closeable)in);
 		}
 		return false;
 	} //}}}
@@ -169,7 +170,7 @@ public class XMLUtilities
 	 * by jEdit, but anyone is free to use the method if it sounds
 	 * usable.</p>
 	 */
-	public static InputSource findEntity(String systemId, String test, Class where)
+	public static InputSource findEntity(String systemId, String test, Class<?> where)
 	{
 		if (systemId != null && systemId.endsWith(test))
 		{
diff --git a/org/jedit/core/FileOpenerService.java b/org/jedit/core/FileOpenerService.java
index 543a39a..38302d4 100644
--- a/org/jedit/core/FileOpenerService.java
+++ b/org/jedit/core/FileOpenerService.java
@@ -1,5 +1,5 @@
 /* FileOpenerService.java
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright © 2012 Alan Ezust
@@ -23,7 +23,6 @@ package org.jedit.core;
 import org.gjt.sp.jedit.ServiceManager;
 import org.gjt.sp.jedit.View;
 import org.gjt.sp.jedit.jEdit;
-import org.gjt.sp.util.Log;
 
 /**  File Opener Service.
   *
diff --git a/org/jedit/core/MigrationService.java b/org/jedit/core/MigrationService.java
index 7fc369d..d7b7211 100644
--- a/org/jedit/core/MigrationService.java
+++ b/org/jedit/core/MigrationService.java
@@ -1,43 +1,42 @@
-/* MigrationService.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.jedit.core;
-
-/** A Migration service.
- * There is currently only one concrete implementation of this interface and no
- * general way to add new MigrationServices yet.
- * <br />
- * The goal of migration is usually to replace old properties or data files
- * with a new set, located elsewhere. The fact is that depending on where
- * the data needs to be updated, the migration may need to be done at
-*  different places during jEdit's startup. <br />
- * There is no specific time that all migration services are called currently.
- * The service and interface exists primarily so you don't need to add a compilation
- * dependency of the org.gjt.sp.jEdit class to your MigrationService class. <br />
- * <br />
- * Concrete instances need to gurantee that the migration itself is only done
- * once.
- *
- * @author Matthieu Casanova
- */
-public interface MigrationService
-{
-	void migrate();
-}
+/* MigrationService.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.jedit.core;
+
+/** A Migration service.
+ * <br />
+ * The goal of migration is usually to replace old properties or data files
+ * with a new set, located elsewhere. The fact is that depending on where
+ * the data needs to be updated, the migration may need to be done at
+*  different places during jEdit's startup. <br />
+ * There is no specific time that all migration services are called currently.
+ * The service and interface exists primarily so you don't need to add a compilation
+ * dependency of the org.gjt.sp.jEdit class to your MigrationService class. <br />
+ * <br />
+ * Concrete instances need to guarantee that the migration itself is only done
+ * once.
+ * @see org.jedit.migration.OneTimeMigrationService
+ *
+ * @author Matthieu Casanova
+ */
+public interface MigrationService
+{
+	void migrate();
+}
diff --git a/org/jedit/io/Native2ASCIIEncoding.java b/org/jedit/io/Native2ASCIIEncoding.java
new file mode 100644
index 0000000..4bf8ace
--- /dev/null
+++ b/org/jedit/io/Native2ASCIIEncoding.java
@@ -0,0 +1,474 @@
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=8:indentSize=8:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2012 jEdit contributors
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.jedit.io;
+
+//{{{ Imports
+import java.io.FilterReader;
+import java.io.FilterWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PushbackReader;
+import java.io.Reader;
+import java.io.Writer;
+import java.lang.reflect.InvocationTargetException;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetEncoder;
+import java.nio.charset.MalformedInputException;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.gjt.sp.jedit.io.CharsetEncoding;
+import org.gjt.sp.jedit.io.Encoding;
+//}}}
+
+/**
+ * ISO-8859-1 with unicode escapes as e. g. needed for http://download.oracle.com/javase/6/docs/api/java/util/Properties.html
+ *
+ * @author Björn "Vampire" Kautler
+ * @since 5.1pre1
+ */
+public class Native2ASCIIEncoding implements Encoding
+{
+	//{{{ implements Encoding
+	@Nonnull
+	public Reader getTextReader(@Nonnull InputStream in) throws IOException
+	{
+		return new Native2ASCIIReader(in, false);
+	}
+
+	@Nonnull
+	public Writer getTextWriter(@Nonnull OutputStream out) throws IOException
+	{
+		return new FilterWriter(asciiEncoding.getTextWriter(out))
+		{
+			@Override
+			@Nonnull
+			public Writer append(@Nullable CharSequence csq) throws IOException
+			{
+				write((csq == null) ? "null" : csq.toString());
+				return this;
+			}
+
+			@Override
+			@Nonnull
+			public Writer append(@Nullable CharSequence csq, int start, int end) throws IOException
+			{
+				CharSequence cs = (csq == null ? "null" : csq);
+				write(cs.subSequence(start, end).toString());
+				return this;
+			}
+
+			@Override
+			@Nonnull
+			public Writer append(char c) throws IOException
+			{
+				write(c);
+				return this;
+			}
+
+			@Override
+			public void write(@Nonnull String str) throws IOException
+			{
+				write(str, 0, str.length());
+			}
+
+			@Override
+			public void write(@Nonnull char cbuf[]) throws IOException
+			{
+				write(cbuf, 0, cbuf.length);
+			}
+
+			@Override
+			public void write(@Nonnull String str, int off, int len) throws IOException
+			{
+				write(str.substring(off, off + len).toCharArray());
+			}
+
+			@Override
+			public void write(@Nonnull char[] cbuf, int off, int len) throws IOException
+			{
+				char[] buf = new char[len * 6];
+				int i = 0;
+				for (int j = off, j2 = off + len; j < j2; j++)
+				{
+					char c = cbuf[j];
+					if (asciiEncoder.canEncode(c))
+					{
+						buf[i++] = c;
+					} else
+					{
+						System.arraycopy(String.format("\\u%04X", (int) c).toCharArray(), 0,
+								 buf, i, 6);
+						i += 6;
+					}
+				}
+				super.write(buf, 0, i);
+			}
+
+			@Override
+			public void write(int c) throws IOException
+			{
+				if (asciiEncoder.canEncode((char) c))
+				{
+					super.write(c);
+				} else
+				{
+					write(String.format("\\u%04X", c));
+				}
+			}
+		};
+	}
+
+	@Nonnull
+	public Reader getPermissiveTextReader(@Nonnull InputStream in) throws IOException
+	{
+		return new Native2ASCIIReader(in, true);
+	}
+	//}}}
+
+	//{{{ Package private members
+	@Nonnull
+	Reader getTextReader(@Nonnull InputStream in, @Nullable Class<? extends PushbackReader> clazz)
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		return new Native2ASCIIReader(in, false, clazz);
+	}
+
+	@Nonnull
+	Reader getPermissiveTextReader(@Nonnull InputStream in, @Nullable Class<? extends PushbackReader> clazz)
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		return new Native2ASCIIReader(in, true, clazz);
+	}
+	//}}}
+
+	//{{{ Private members
+
+	//{{{ Instance variables
+	private final CharsetEncoder asciiEncoder = Charset.forName("ASCII").newEncoder();
+	private final CharsetEncoding asciiEncoding = new CharsetEncoding("ASCII");
+	//}}}
+
+	private static class Native2ASCIIReader extends FilterReader
+	{
+		private Native2ASCIIReader(@Nonnull InputStream in, boolean permissive) throws IOException
+		{
+			super(new PushbackReader(iso_8859_1Encoding.getTextReader(in), 5));
+			this.in = (PushbackReader) super.in;
+			this.permissive = permissive;
+		}
+
+		private Native2ASCIIReader(@Nonnull InputStream in, boolean permissive,
+					   @Nullable Class<? extends PushbackReader> clazz)
+			throws IOException, NoSuchMethodException, InvocationTargetException, IllegalAccessException,
+			       InstantiationException
+		{
+			super(clazz == null
+			      ? new PushbackReader(iso_8859_1Encoding.getTextReader(in), 5)
+			      : clazz.getConstructor(Reader.class, int.class)
+				     .newInstance(iso_8859_1Encoding.getTextReader(in), 5));
+			this.in = (PushbackReader) super.in;
+			this.permissive = permissive;
+		}
+
+		@Override
+		public int read() throws IOException
+		{
+			// delegate read to the ISO-8859-1
+			int result = in.read();
+			// does not start escape sequence or is escaped
+			// (EOF - which is signalled by -1 - is also captured)
+			if ((result != '\\') || escaped)
+			{
+				escaped = false;
+				return result;
+			}
+			// check for following character
+			int read = in.read();
+			// EOF reached
+			if (read == -1)
+			{
+				return result;
+			}
+			// not an escape sequence
+			if (read != 'u')
+			{
+				escaped = true;
+				in.unread(read);
+				return result;
+			}
+			// read in remainder of possible escape sequence
+			char[] escape = { 'u', '\0', '\0', '\0', '\0' };
+			read = 1 + in.read(escape, 1, 4);
+			// EOF reached during escape sequence
+			if (read == 0)
+			{
+				if (permissive)
+				{
+					escaped = true;
+					in.unread('u');
+					return result;
+				} else
+				{
+					throw new MalformedInputException(1);
+				}
+			}
+			// read < 5 doesn't necessarily mean EOF but could also
+			// mean no more input available currently, so try to read on
+			while (read < 5)
+			{
+				int read2 = in.read(escape, read, 5 - read);
+				// we have really hit EOF, so there is not
+				// enough input for an escape sequence
+				if (read2 == -1)
+				{
+					if (permissive)
+					{
+						escaped = true;
+						in.unread(escape, 0, read);
+						return result;
+					} else
+					{
+						throw new MalformedInputException(1);
+					}
+				}
+				read += read2;
+			}
+			// no unicode escape with non-hex characters in positions 3-6
+			for (int i = 1; i < 5; i++)
+			{
+				char e = escape[i];
+				if (!(((e >= '0') && (e <= '9')) || ((e >= 'a') && (e <= 'f')) || ((e >= 'A') && (e
+														  <= 'F'))))
+				{
+					if (permissive)
+					{
+						escaped = true;
+						in.unread(escape, 0, read);
+						return result;
+					} else
+					{
+						throw new MalformedInputException(1);
+					}
+				}
+			}
+			// valid unicode escape
+			escaped = false;
+			return Integer.parseInt(new String(escape, 1, 4), 16);
+		}
+
+		@Override
+		public int read(CharBuffer target) throws IOException
+		{
+			int len = target.remaining();
+			char[] cbuf = new char[len];
+			int n = read(cbuf, 0, len);
+			if (n > 0)
+			{
+				target.put(cbuf, 0, n);
+			}
+			return n;
+		}
+
+		@Override
+		public int read(char[] cbuf) throws IOException
+		{
+			return read(cbuf, 0, cbuf.length);
+		}
+
+		@Override
+		public int read(char[] cbuf, int off, int len) throws IOException
+		{
+			return readn(cbuf, off, len);
+		}
+
+		private int readn(char[] cbuf, int off, int len) throws IOException
+		{
+			// read 5 chars more than requested to have
+			// more input if last character is a '\'
+			int bufLen = len + 5;
+			char[] buf = new char[bufLen];
+			// delegate read to the ISO-8859-1
+			int read = in.read(buf);
+			// EOF reached
+			if (read == -1)
+			{
+				return read;
+			}
+			// read = read from underlying stream
+			// result = read after conversion
+			int result = 0;
+			// how many additional characters need to be read
+			// because of collapsed escape sequences
+			int needed = 0;
+			// iterate read chars but maximum len ones
+			int i;
+outer:
+			for (i = 0; (i < read) && (i < len); i++)
+			{
+				// character under consideration
+				char c = buf[i];
+				// does not start escape sequence
+				if ((c != '\\') || escaped)
+				{
+					// add to result buffer and
+					// continue to next character
+					escaped = false;
+					cbuf[off + result++] = c;
+					continue;
+				}
+				// less than 5 characters left after current
+				// position because either there was no more
+				// input available or because of EOF
+				if (read - i - 1 < 5)
+				{
+					// try to read in more characters to
+					// complete the escape sequence
+					while (read < i + 1 + 5)
+					{
+						// read in missing characters
+						int read2 = in.read(buf, read, i + 1 + 5 - read);
+						// EOF reached
+						if (read2 == -1)
+						{
+							// add to result buffer and continue to next character if
+							// - permissive or
+							// - EOF reached after backslash or
+							// - not an escape sequence,
+							// otherwise throw exception
+							if (permissive || (read - i - 1 == 0) || (buf[i + 1] != 'u'))
+							{
+								escaped = true;
+								cbuf[off + result++] = c;
+								continue outer;
+							} else
+							{
+								throw new MalformedInputException(1);
+							}
+						}
+						read += read2;
+					}
+				}
+				// no unicode escape without 'u' at second position
+				if (buf[i + 1] != 'u')
+				{
+					// add to result buffer and
+					// continue to next character
+					escaped = true;
+					cbuf[off + result++] = c;
+					continue;
+				}
+				// no unicode escape with non-hex characters in positions 3-6
+				for (int j = i + 2, j2 = i + 6; j < j2; j++)
+				{
+					char e = buf[j];
+					if (!(((e >= '0') && (e <= '9')) || ((e >= 'a') && (e <= 'f')) || ((e >= 'A')
+													   && (e
+													       <= 'F'))))
+					{
+						// add to result buffer and continue to next character
+						// if permissive, otherwise throw exception
+						if (permissive)
+						{
+							escaped = true;
+							cbuf[off + result++] = c;
+							continue outer;
+						} else
+						{
+							throw new MalformedInputException(1);
+						}
+					}
+				}
+				// valid unicode escape
+				escaped = false;
+				cbuf[off + result++] = (char) Integer.parseInt(new String(buf, i + 2, 4), 16);
+				// need 5 more chars that were consumed for escape collapsing,
+				// but only if the escape sequence was not in the additional space
+				needed += Math.min(len - i - 1, 5);
+				// advance pointer
+				i += 5;
+			}
+			in.unread(buf, i, read - i);
+			// nothing was collapsed
+			if (needed == 0)
+			{
+				return result;
+			}
+			// read more chars due to escape collapsing
+			read = readn(cbuf, off + result, needed);
+			// EOF reached
+			if (read == -1)
+			{
+				return result;
+			}
+			return result + read;
+		}
+
+		@Override
+		public long skip(long toSkip) throws IOException
+		{
+			if (toSkip < 0)
+			{
+				throw new IllegalArgumentException("skip value is negative");
+			}
+			int skipBufferSize = (int) Math.min(toSkip, MAX_SKIP_BUFFER_SIZE);
+			if ((skipBuffer == null) || (skipBuffer.length < skipBufferSize))
+			{
+				skipBuffer = new char[skipBufferSize];
+			}
+			long remaining = toSkip;
+			synchronized (in)
+			{
+				while (remaining > 0)
+				{
+					int skipped = read(skipBuffer, 0, (int) Math.min(remaining, skipBufferSize));
+					if (skipped == -1)
+					{
+						break;
+					}
+					remaining -= skipped;
+				}
+			}
+			return toSkip - remaining;
+		}
+
+		//{{{ Private members
+
+		private static final int MAX_SKIP_BUFFER_SIZE = 8192;
+		private static final Encoding iso_8859_1Encoding = new CharsetEncoding("ISO-8859-1");
+
+		//{{{ Instance variables
+		private PushbackReader in;
+		private boolean permissive;
+		private char[] skipBuffer;
+		private boolean escaped;
+		//}}}
+
+		//}}}
+	}
+
+	//}}}
+}
diff --git a/org/jedit/keymap/Keymap.java b/org/jedit/keymap/Keymap.java
index 6078ec7..20601f8 100644
--- a/org/jedit/keymap/Keymap.java
+++ b/org/jedit/keymap/Keymap.java
@@ -1,49 +1,49 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.jedit.keymap;
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 5.0
- */
-public interface Keymap
-{
-	/**
-	 * Returns a shortcut.
-	 * @param name the shortcut name
-	 * @return the action name or <code>null</code> if there is no shortcut
-	 */
-	String getShortcut(String name);
-	
-	/**
-	 * Set a new shortcut.
-	 * @param name the shortcut name
-	 * @param shortcut the action name, or <code>null</code> to delete a 
-	 * shortcut
-	 */
-	void setShortcut(String name, String shortcut);
-	
-	/**
-	 * Save the keymaps.
-	 */
-	void save();
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.jedit.keymap;
+
+/**
+ * @author Matthieu Casanova
+ * @since jEdit 5.0
+ */
+public interface Keymap
+{
+	/**
+	 * Returns a shortcut.
+	 * @param name the shortcut name
+	 * @return the action name or <code>null</code> if there is no shortcut
+	 */
+	String getShortcut(String name);
+	
+	/**
+	 * Set a new shortcut.
+	 * @param name the shortcut name
+	 * @param shortcut the action name, or <code>null</code> to delete a 
+	 * shortcut
+	 */
+	void setShortcut(String name, String shortcut);
+	
+	/**
+	 * Save the keymaps.
+	 */
+	void save();
+}
diff --git a/org/jedit/keymap/KeymapFileFilter.java b/org/jedit/keymap/KeymapFileFilter.java
index cf50f55..bb78d24 100644
--- a/org/jedit/keymap/KeymapFileFilter.java
+++ b/org/jedit/keymap/KeymapFileFilter.java
@@ -1,40 +1,40 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.jedit.keymap;
-
-import java.io.File;
-import java.io.FileFilter;
-
-/**
- * A FileFilter that returns keymaps files.
- *
- * @author Matthieu Casanova
- * @since jEdit 5.0
- */
-public class KeymapFileFilter implements FileFilter
-{
-	@Override
-	public boolean accept(File pathname)
-	{
-		return pathname.isFile() && pathname.getName().endsWith("_keys.props");
-	}
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.jedit.keymap;
+
+import java.io.File;
+import java.io.FileFilter;
+
+/**
+ * A FileFilter that returns keymaps files.
+ *
+ * @author Matthieu Casanova
+ * @since jEdit 5.0
+ */
+public class KeymapFileFilter implements FileFilter
+{
+	@Override
+	public boolean accept(File pathname)
+	{
+		return pathname.isFile() && pathname.getName().endsWith("_keys.props");
+	}
+}
diff --git a/org/jedit/keymap/KeymapImpl.java b/org/jedit/keymap/KeymapImpl.java
index 8c6909d..11eca34 100644
--- a/org/jedit/keymap/KeymapImpl.java
+++ b/org/jedit/keymap/KeymapImpl.java
@@ -1,165 +1,166 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.jedit.keymap;
-
-//{{{ Imports
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import org.gjt.sp.util.IOUtilities;
-import org.gjt.sp.util.Log;
-//}}}
-
-/**
- * The default keymap implementation.
- * @author Matthieu Casanova
- * @since jEdit 5.0
- */
-class KeymapImpl implements Keymap
-{
-	protected Properties props;
-
-	protected final String name;
-	private final File file;
-	private boolean modified;
-
-	//{{{ KeymapImpl() constructor
-	KeymapImpl(String name, File file)
-	{
-		this.name = name;
-		this.file = file;
-		loadProperties();
-	} //}}}
-
-	//{{{ getInputStream() method
-	protected InputStream getInputStream()
-	{
-		return Keymap.class.getResourceAsStream(name + "_keys.props");
-	} //}}}
-
-	//{{{ loadProperties() method
-	private void loadProperties()
-	{
-		props = new Properties();
-		InputStream in = null;
-		try
-		{
-			in = new BufferedInputStream(new FileInputStream(file));
-			props.load(in);
-		}
-		catch (IOException e)
-		{
-			Log.log(Log.ERROR, this, "Unable to load properties", e);
-		}
-		finally
-		{
-			IOUtilities.closeQuietly(in);
-		}
-	} //}}}
-
-	//{{{ getShortcut() method
-	@Override
-	public String getShortcut(String name)
-	{
-		String property = props.getProperty(name);
-		return property;
-	} //}}}
-
-	//{{{ setShortcut() method
-	@Override
-	public void setShortcut(String name, String shortcut)
-	{
-		if (shortcut == null || shortcut.isEmpty())
-		{
-			if (props.containsKey(name))
-			{
-				modified = true;
-				props.remove(name);
-			}
-			return;
-		}
-		String oldShortcut = props.getProperty(name);
-		if (!shortcut.equals(oldShortcut))
-		{
-			modified = true;
-			props.setProperty(name, shortcut);
-		}
-	} //}}}
-
-	//{{{ toString() method
-	@Override
-	public String toString()
-	{
-		return name;
-	} //}}}
-
-	//{{{ hashCode() method
-	@Override
-	public int hashCode()
-	{
-		return name.hashCode();
-	} //}}}
-
-	//{{{ equals() method
-	@Override
-	public boolean equals(Object obj)
-	{
-		if (!(obj instanceof Keymap))
-			return false;
-
-		Keymap keymap = (Keymap) obj;
-		return name.equals(keymap.toString());
-	} //}}}
-
-	//{{{ save() method
-	@Override
-	public void save()
-	{
-		if (modified)
-		{
-			modified = false;
-			File userKeymapFile = KeymapManagerImpl.getUserKeymapFile(name);
-			userKeymapFile.getParentFile().mkdirs();
-			BufferedOutputStream out = null;
-			try
-			{
-				out = new BufferedOutputStream(new FileOutputStream(userKeymapFile));
-				props.store(out, "jEdit's keymap " + name);
-			}
-			catch (IOException e)
-			{
-				Log.log(Log.ERROR, this, "Unable to save properties", e);
-			}
-			finally
-			{
-				IOUtilities.closeQuietly(out);
-			}
-		}
-
-	} //}}}
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.jedit.keymap;
+
+//{{{ Imports
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.gjt.sp.util.IOUtilities;
+import org.gjt.sp.util.Log;
+//}}}
+
+/**
+ * The default keymap implementation.
+ * @author Matthieu Casanova
+ * @since jEdit 5.0
+ */
+class KeymapImpl implements Keymap
+{
+	protected Properties props;
+
+	protected final String name;
+	private final File file;
+	private boolean modified;
+
+	//{{{ KeymapImpl() constructor
+	KeymapImpl(String name, File file)
+	{
+		this.name = name;
+		this.file = file;
+		loadProperties();
+	} //}}}
+
+	//{{{ getInputStream() method
+	protected InputStream getInputStream()
+	{
+		return Keymap.class.getResourceAsStream(name + "_keys.props");
+	} //}}}
+
+	//{{{ loadProperties() method
+	private void loadProperties()
+	{
+		props = new Properties();
+		InputStream in = null;
+		try
+		{
+			in = new BufferedInputStream(new FileInputStream(file));
+			props.load(in);
+		}
+		catch (IOException e)
+		{
+			Log.log(Log.ERROR, this, "Unable to load properties", e);
+		}
+		finally
+		{
+			IOUtilities.closeQuietly((Closeable)in);
+		}
+	} //}}}
+
+	//{{{ getShortcut() method
+	@Override
+	public String getShortcut(String name)
+	{
+		String property = props.getProperty(name);
+		return property;
+	} //}}}
+
+	//{{{ setShortcut() method
+	@Override
+	public void setShortcut(String name, String shortcut)
+	{
+		if (shortcut == null || shortcut.isEmpty())
+		{
+			if (props.containsKey(name))
+			{
+				modified = true;
+				props.remove(name);
+			}
+			return;
+		}
+		String oldShortcut = props.getProperty(name);
+		if (!shortcut.equals(oldShortcut))
+		{
+			modified = true;
+			props.setProperty(name, shortcut);
+		}
+	} //}}}
+
+	//{{{ toString() method
+	@Override
+	public String toString()
+	{
+		return name;
+	} //}}}
+
+	//{{{ hashCode() method
+	@Override
+	public int hashCode()
+	{
+		return name.hashCode();
+	} //}}}
+
+	//{{{ equals() method
+	@Override
+	public boolean equals(Object obj)
+	{
+		if (!(obj instanceof Keymap))
+			return false;
+
+		Keymap keymap = (Keymap) obj;
+		return name.equals(keymap.toString());
+	} //}}}
+
+	//{{{ save() method
+	@Override
+	public void save()
+	{
+		if (modified)
+		{
+			modified = false;
+			File userKeymapFile = KeymapManagerImpl.getUserKeymapFile(name);
+			userKeymapFile.getParentFile().mkdirs();
+			BufferedOutputStream out = null;
+			try
+			{
+				out = new BufferedOutputStream(new FileOutputStream(userKeymapFile));
+				props.store(out, "jEdit's keymap " + name);
+			}
+			catch (IOException e)
+			{
+				Log.log(Log.ERROR, this, "Unable to save properties", e);
+			}
+			finally
+			{
+				IOUtilities.closeQuietly((Closeable)out);
+			}
+		}
+
+	} //}}}
+}
diff --git a/org/jedit/keymap/KeymapManager.java b/org/jedit/keymap/KeymapManager.java
index 0f37027..91e71ae 100644
--- a/org/jedit/keymap/KeymapManager.java
+++ b/org/jedit/keymap/KeymapManager.java
@@ -1,91 +1,91 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.jedit.keymap;
-
-import java.util.Collection;
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 5.0
- */
-public interface KeymapManager
-{
-	String DEFAULT_KEYMAP_NAME = "jEdit";
-	/**
-	 * Returns the current keymap.
-	 * @return the current keymap
-	 */
-	Keymap getKeymap();
-
-	void reload();
-
-	Collection<String> getKeymapNames();
-
-	/**
-	 * Returns the keymap with that name.
-	 * @param name the keymap name
-	 * @return the user keymap of that name, if it exists, or the system keymap if it doesn't.
-	 * If none exists <code>null</code> is returned
-	 */
-	Keymap getKeymap(String name);
-
-	/**
-	 * Returns the state of the keymap
-	 * @param name the name of the keymap
-	 * @return a state.
-	 */
-	State getKeymapState(String name);
-
-	/**
-	 * Reset the keymap to it's original state if it was a modified system keymap
-	 * @param name the keymap name
-	 */
-	void resetKeymap(String name);
-
-	/**
-	 * Delete a user keymap.
-	 * @param name the keymap name
-	 */
-	void deleteUserKeymap(String name);
-
-	/**
-	 * Copy the keymap to another one
-	 * @param name the original keymap
-	 * @param newName the new keymap
-	 */
-	boolean copyKeymap(String name, String newName);
-
-	/**
-	 * The states of the keymaps
-	 */
-	enum State
-	{
-		/** User keymap. */
-		User,
-		/** System keymap. */
-		System,
-		/** Modified system keymap. */
-		SystemModified,
-		/** Unknown keymap (doesn't exists). */
-		Unknown
-	}
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.jedit.keymap;
+
+import java.util.Collection;
+
+/**
+ * @author Matthieu Casanova
+ * @since jEdit 5.0
+ */
+public interface KeymapManager
+{
+	String DEFAULT_KEYMAP_NAME = "jEdit";
+	/**
+	 * Returns the current keymap.
+	 * @return the current keymap
+	 */
+	Keymap getKeymap();
+
+	void reload();
+
+	Collection<String> getKeymapNames();
+
+	/**
+	 * Returns the keymap with that name.
+	 * @param name the keymap name
+	 * @return the user keymap of that name, if it exists, or the system keymap if it doesn't.
+	 * If none exists <code>null</code> is returned
+	 */
+	Keymap getKeymap(String name);
+
+	/**
+	 * Returns the state of the keymap
+	 * @param name the name of the keymap
+	 * @return a state.
+	 */
+	State getKeymapState(String name);
+
+	/**
+	 * Reset the keymap to it's original state if it was a modified system keymap
+	 * @param name the keymap name
+	 */
+	void resetKeymap(String name);
+
+	/**
+	 * Delete a user keymap.
+	 * @param name the keymap name
+	 */
+	void deleteUserKeymap(String name);
+
+	/**
+	 * Copy the keymap to another one
+	 * @param name the original keymap
+	 * @param newName the new keymap
+	 */
+	boolean copyKeymap(String name, String newName);
+
+	/**
+	 * The states of the keymaps
+	 */
+	enum State
+	{
+		/** User keymap. */
+		User,
+		/** System keymap. */
+		System,
+		/** Modified system keymap. */
+		SystemModified,
+		/** Unknown keymap (doesn't exists). */
+		Unknown
+	}
+}
diff --git a/org/jedit/keymap/KeymapManagerImpl.java b/org/jedit/keymap/KeymapManagerImpl.java
index fd7746b..07bfec6 100644
--- a/org/jedit/keymap/KeymapManagerImpl.java
+++ b/org/jedit/keymap/KeymapManagerImpl.java
@@ -1,240 +1,241 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.jedit.keymap;
-
-//{{{ Imports
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.swing.JOptionPane;
-
-import org.gjt.sp.jedit.IPropertyManager;
-import org.gjt.sp.util.IOUtilities;
-import org.gjt.sp.util.Log;
-//}}}
-
-/**
- * The default keymap manager implementation.
- * @author Matthieu Casanova
- * @since jEdit 5.0
- */
-public class KeymapManagerImpl implements KeymapManager
-{
-	private Keymap currentKeymap;
-	private final IPropertyManager propertyManager;
-	/**
-	 * The userKeymapFolder, it can be null if jEdit runs with nosettings;
-	 */
-	private static File userKeymapFolder;
-	private final File systemKeymapFolder;
-	
-
-	//{{{ KeymapManagerImpl() constructor
-	public KeymapManagerImpl(IPropertyManager propertyManager,
-				 File systemKeymapFolder,
-				 File userKeymapFolder)
-	{
-		this.propertyManager = propertyManager;
-		this.systemKeymapFolder = systemKeymapFolder;
-		if (!systemKeymapFolder.isDirectory())
-		{
-			Log.log(Log.ERROR, this, "System keymap folder do not exist, your installation is broken."
-						 + "Install keymaps in " + systemKeymapFolder.getAbsolutePath());
-			JOptionPane.showMessageDialog(null, "System keymap folder do not exist, your installation is broken."
-							    + "Install keymaps in " + systemKeymapFolder.getAbsolutePath(), "Fatal Error",
-						      JOptionPane.ERROR_MESSAGE);
-			System.exit(10);
-		}
-		this.userKeymapFolder = userKeymapFolder;
-	} //}}}
-
-	//{{{ getKeymap() method
-	@Override
-	public Keymap getKeymap()
-	{
-		return currentKeymap;
-	} //}}}
-
-	//{{{ getKeymapNames() method
-	@Override
-	public Collection<String> getKeymapNames()
-	{
-		Collection<String> systemKeymapNames = getKeymapsFromFolder(systemKeymapFolder);
-		Collection<String> userKeymapNames = getKeymapsFromFolder(userKeymapFolder);
-		Set<String> keyMaps = new HashSet<String>();
-		keyMaps.addAll(systemKeymapNames);
-		keyMaps.addAll(userKeymapNames);
-		return keyMaps;
-	} //}}}
-
-	//{{{ getKeymap() method
-	@Override
-	public Keymap getKeymap(String name)
-	{
-		File keymapFile = getKeymapFile(name);
-		Keymap keymap = null;
-		if (keymapFile.isFile())
-			keymap = new KeymapImpl(name, keymapFile);
-		return keymap;
-	} //}}}
-
-	//{{{ getKeymapState() method
-	@Override
-	public State getKeymapState(String name)
-	{
-		File systemKeymapFile = getSystemKeymapFile(name);
-		File userKeymapFile = getUserKeymapFile(name);
-		if (userKeymapFile.isFile())
-		{
-			if (systemKeymapFile.isFile())
-				return State.SystemModified;
-			return State.User;
-		}
-		if (systemKeymapFile.isFile())
-			return State.System;
-		return State.Unknown;
-	} //}}}
-
-	//{{{ resetKeymap() method
-	@Override
-	public void resetKeymap(String name)
-	{
-		State keymapState = getKeymapState(name);
-		if (keymapState == State.SystemModified)
-		{
-			File userFile = getUserKeymapFile(name);
-			userFile.delete();
-		}
-	} //}}}
-
-	//{{{ deleteUserKeymap() method
-	@Override
-	public void deleteUserKeymap(String name)
-	{
-		State keymapState = getKeymapState(name);
-		if (keymapState == State.User)
-		{
-			File userFile = getUserKeymapFile(name);
-			userFile.delete();
-		}
-	} //}}}
-
-	//{{{ copyKeymap() method
-	@Override
-	public boolean copyKeymap(String name, String newName)
-	{
-		Log.log(Log.DEBUG, this, "copyKeymap(" + name + ',' + newName + ')');
-		File keymapFile = getUserKeymapFile(newName);
-		if (keymapFile.exists())
-			throw new IllegalArgumentException("Keymap " + newName + " already exists");
-
-		File originalKeymap = getKeymapFile(name);
-		if (!originalKeymap.isFile())
-			throw new IllegalArgumentException("Keymap " + name + " doesn't exist");
-		keymapFile.getParentFile().mkdirs();
-		BufferedInputStream in = null;
-		BufferedOutputStream out = null;
-		Log.log(Log.DEBUG, this, "Copying "+ originalKeymap.getAbsolutePath() + " to " + keymapFile.getAbsolutePath());
-		try
-		{
-			in = new BufferedInputStream(new FileInputStream(originalKeymap));
-			out = new BufferedOutputStream(new FileOutputStream(keymapFile));
-			IOUtilities.copyStream(null, in, out, false);
-			return true;
-		}
-		catch (IOException e)
-		{
-			Log.log(Log.ERROR, this, e);
-		}
-		finally
-		{
-			IOUtilities.closeQuietly(in);
-			IOUtilities.closeQuietly(out);
-		}
-		return false;
-	} //}}}
-
-	//{{{ reload() method
-	@Override
-	public void reload()
-	{
-		String name = getCurrentKeymapName();
-		currentKeymap = getKeymap(name);
-		if (currentKeymap == null)
-			currentKeymap = getKeymap(DEFAULT_KEYMAP_NAME);
-	} //}}}
-
-	//{{{ getKeymapFile() method
-	private File getKeymapFile(String name)
-	{
-		File file = getUserKeymapFile(name);
-		if (!file.isFile())
-			file = getSystemKeymapFile(name);
-		return file;
-	} //}}}
-
-	//{{{ getUserKeymapFile() method
-	static File getUserKeymapFile(String name)
-	{
-		return new File(userKeymapFolder, name + "_keys.props");
-	} //}}}
-
-	//{{{ getSystemKeymapFile() method
-	private File getSystemKeymapFile(String name)
-	{
-		return new File(systemKeymapFolder, name + "_keys.props");
-	} //}}}
-
-	//{{{ getKeymapsFromFolder() method
-	private static Collection<String> getKeymapsFromFolder(File folder)
-	{
-		if (folder == null)
-			return Collections.emptyList();
-		Collection<String> names = new ArrayList<String>();
-		File[] files = folder.listFiles(new KeymapFileFilter());
-		if (files != null)
-		{
-			for (File file : files)
-			{
-				String filename = file.getName();
-				String name = filename.substring(0, filename.length() - 11);
-				names.add(name);
-			}
-		}
-		return names;
-	} //}}}
-
-	//{{{ getCurrentKeymapName() method
-	private String getCurrentKeymapName()
-	{
-		return propertyManager.getProperty("keymap.current");
-	} //}}}
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.jedit.keymap;
+
+//{{{ Imports
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.swing.JOptionPane;
+
+import org.gjt.sp.jedit.IPropertyManager;
+import org.gjt.sp.util.IOUtilities;
+import org.gjt.sp.util.Log;
+//}}}
+
+/**
+ * The default keymap manager implementation.
+ * @author Matthieu Casanova
+ * @since jEdit 5.0
+ */
+public class KeymapManagerImpl implements KeymapManager
+{
+	private Keymap currentKeymap;
+	private final IPropertyManager propertyManager;
+	/**
+	 * The userKeymapFolder, it can be null if jEdit runs with nosettings;
+	 */
+	private static File userKeymapFolder;
+	private final File systemKeymapFolder;
+
+
+	//{{{ KeymapManagerImpl() constructor
+	public KeymapManagerImpl(IPropertyManager propertyManager,
+				 File systemKeymapFolder,
+				 File userKeymapFolder)
+	{
+		this.propertyManager = propertyManager;
+		this.systemKeymapFolder = systemKeymapFolder;
+		if (!systemKeymapFolder.isDirectory())
+		{
+			Log.log(Log.ERROR, this, "System keymap folder do not exist, your installation is broken."
+						 + "Install keymaps in " + systemKeymapFolder.getAbsolutePath());
+			JOptionPane.showMessageDialog(null, "System keymap folder do not exist, your installation is broken."
+							    + "Install keymaps in " + systemKeymapFolder.getAbsolutePath(), "Fatal Error",
+						      JOptionPane.ERROR_MESSAGE);
+			System.exit(10);
+		}
+		KeymapManagerImpl.userKeymapFolder = userKeymapFolder;
+	} //}}}
+
+	//{{{ getKeymap() method
+	@Override
+	public Keymap getKeymap()
+	{
+		return currentKeymap;
+	} //}}}
+
+	//{{{ getKeymapNames() method
+	@Override
+	public Collection<String> getKeymapNames()
+	{
+		Collection<String> systemKeymapNames = getKeymapsFromFolder(systemKeymapFolder);
+		Collection<String> userKeymapNames = getKeymapsFromFolder(userKeymapFolder);
+		Set<String> keyMaps = new HashSet<String>();
+		keyMaps.addAll(systemKeymapNames);
+		keyMaps.addAll(userKeymapNames);
+		return keyMaps;
+	} //}}}
+
+	//{{{ getKeymap() method
+	@Override
+	public Keymap getKeymap(String name)
+	{
+		File keymapFile = getKeymapFile(name);
+		Keymap keymap = null;
+		if (keymapFile.isFile())
+			keymap = new KeymapImpl(name, keymapFile);
+		return keymap;
+	} //}}}
+
+	//{{{ getKeymapState() method
+	@Override
+	public State getKeymapState(String name)
+	{
+		File systemKeymapFile = getSystemKeymapFile(name);
+		File userKeymapFile = getUserKeymapFile(name);
+		if (userKeymapFile.isFile())
+		{
+			if (systemKeymapFile.isFile())
+				return State.SystemModified;
+			return State.User;
+		}
+		if (systemKeymapFile.isFile())
+			return State.System;
+		return State.Unknown;
+	} //}}}
+
+	//{{{ resetKeymap() method
+	@Override
+	public void resetKeymap(String name)
+	{
+		State keymapState = getKeymapState(name);
+		if (keymapState == State.SystemModified)
+		{
+			File userFile = getUserKeymapFile(name);
+			userFile.delete();
+		}
+	} //}}}
+
+	//{{{ deleteUserKeymap() method
+	@Override
+	public void deleteUserKeymap(String name)
+	{
+		State keymapState = getKeymapState(name);
+		if (keymapState == State.User)
+		{
+			File userFile = getUserKeymapFile(name);
+			userFile.delete();
+		}
+	} //}}}
+
+	//{{{ copyKeymap() method
+	@Override
+	public boolean copyKeymap(String name, String newName)
+	{
+		Log.log(Log.DEBUG, this, "copyKeymap(" + name + ',' + newName + ')');
+		File keymapFile = getUserKeymapFile(newName);
+		if (keymapFile.exists())
+			throw new IllegalArgumentException("Keymap " + newName + " already exists");
+
+		File originalKeymap = getKeymapFile(name);
+		if (!originalKeymap.isFile())
+			throw new IllegalArgumentException("Keymap " + name + " doesn't exist");
+		keymapFile.getParentFile().mkdirs();
+		BufferedInputStream in = null;
+		BufferedOutputStream out = null;
+		Log.log(Log.DEBUG, this, "Copying "+ originalKeymap.getAbsolutePath() + " to " + keymapFile.getAbsolutePath());
+		try
+		{
+			in = new BufferedInputStream(new FileInputStream(originalKeymap));
+			out = new BufferedOutputStream(new FileOutputStream(keymapFile));
+			IOUtilities.copyStream(null, in, out, false);
+			return true;
+		}
+		catch (IOException e)
+		{
+			Log.log(Log.ERROR, this, e);
+		}
+		finally
+		{
+			IOUtilities.closeQuietly((Closeable)in);
+			IOUtilities.closeQuietly((Closeable)out);
+		}
+		return false;
+	} //}}}
+
+	//{{{ reload() method
+	@Override
+	public void reload()
+	{
+		String name = getCurrentKeymapName();
+		currentKeymap = getKeymap(name);
+		if (currentKeymap == null)
+			currentKeymap = getKeymap(DEFAULT_KEYMAP_NAME);
+	} //}}}
+
+	//{{{ getKeymapFile() method
+	private File getKeymapFile(String name)
+	{
+		File file = getUserKeymapFile(name);
+		if (!file.isFile())
+			file = getSystemKeymapFile(name);
+		return file;
+	} //}}}
+
+	//{{{ getUserKeymapFile() method
+	static File getUserKeymapFile(String name)
+	{
+		return new File(userKeymapFolder, name + "_keys.props");
+	} //}}}
+
+	//{{{ getSystemKeymapFile() method
+	private File getSystemKeymapFile(String name)
+	{
+		return new File(systemKeymapFolder, name + "_keys.props");
+	} //}}}
+
+	//{{{ getKeymapsFromFolder() method
+	private static Collection<String> getKeymapsFromFolder(File folder)
+	{
+		if (folder == null)
+			return Collections.emptyList();
+		Collection<String> names = new ArrayList<String>();
+		File[] files = folder.listFiles(new KeymapFileFilter());
+		if (files != null)
+		{
+			for (File file : files)
+			{
+				String filename = file.getName();
+				String name = filename.substring(0, filename.length() - 11);
+				names.add(name);
+			}
+		}
+		return names;
+	} //}}}
+
+	//{{{ getCurrentKeymapName() method
+	private String getCurrentKeymapName()
+	{
+		return propertyManager.getProperty("keymap.current");
+	} //}}}
+}
diff --git a/org/jedit/localization/jedit_cs.props b/org/jedit/localization/jedit_cs.props
index 3fcff62..dd5fa8c 100644
--- a/org/jedit/localization/jedit_cs.props
+++ b/org/jedit/localization/jedit_cs.props
@@ -31,6 +31,7 @@ common.more=Více...
 common.insert=Vložit
 common.add=Přidat
 common.remove=Odebrat
+common.removeCurrent=Odebrat aktuální
 common.moveUp=Posunout nahoru
 common.moveDown=Posunout dolů
 common.clearAll=Vyčistit vše
@@ -741,7 +742,7 @@ badurl.message=Následující URL není validní: {0}\n\
 
 #{{{ Go to line dialog
 goto-line.title=Jdi na řádku
-goto-line.message=Jdi na řádku:
+goto-line.message=Jdi na řádku ({0} - {1}):
 #}}}
 
 #{{{ Word count dialog
@@ -841,6 +842,7 @@ search.settings=Nastavení:
 search.keep=Podržet dialog
 search.keep.mnemonic=k
 search.word=Celé slovo
+search.word.bar=Celé slovo
 search.word.mnemonic=q
 search.case=Ignorovat velikost písmen
 search.case.mnemonic=i
@@ -886,6 +888,7 @@ search.synchronize.tooltip=Nastaví filtr a adresář na aktuálníkoncovku/umí
 search.findBtn=Najít
 search.findBtn.mnemonic=f
 search.replaceBtn=Nahradit
+search.replaceBtn.mnemonic=h
 search.replaceAndFindBtn=Nahradit & Najít
 search.replaceAndFindBtn.mnemonic=r
 search.replaceAllBtn=Nahradit vše
@@ -1603,8 +1606,7 @@ options.textarea.electricBorders=Elektrické okraje (auto skrolování)
 options.textarea.stdNextPrevWord=Go to next/previous word commands eat whitespace
 options.textarea.antiAlias=Vyhlazený hladký text
 options.textarea.antiAlias.tooltip=Zpomaluje zobrazování na některých systémech
-options.textarea.fracFontMetrics=Částečné písmové metriky (pro lepší hladké \
-	zobrazení textu)
+options.textarea.fracFontMetrics=Částečné písmové metriky
 options.textarea.fracFontMetrics.tooltip=Není doporučeno se subpixelovým vyhlazováním
 options.textarea.stripTrailingEOL=Skrýt poslední konec řádku (pokud je)
 options.textarea.completeFromAllBuffers=Dokončit slova ve všech otevřených bufferech (výchozí je \
@@ -1653,10 +1655,6 @@ options.view.fullScreenIncludesMenu=Zobrazit menu panel v režimu "Na celou obra
 options.view.fullScreenIncludesToolbar=Zobrazit panely nástrojů v režimu "Na celou obrazovku"
 options.view.fullScreenIncludesStatus=Zobrazit stavový řádek v režimu "Na celou obrazovku"
 options.bufferset.scope=Rozsah sady bufferů:
-options.editpane.bufferset.contain=Nová sada bufferu obsahuje:
-options.editpane.bufferset.newbufferset.copy=kopii aktuální sady bufferů
-options.editpane.bufferset.newbufferset.empty=prázdný buffer
-options.editpane.bufferset.newbufferset.currentbuffer=pouze aktuální buffer
 #}}}
 
 
@@ -1891,13 +1889,11 @@ vfs.browser.recurse-favorites.title=Oblíbené nelze přidat do sebe
 vfs.browser.recurse-favorites.message=Seznam oblíbených nemůže být přidám do sebe.
 
 vfs.browser.delete-confirm.title=Potvrzení smazání souboru
-vfs.browser.delete-confirm.message=Opravdu chcete smazat následující {1}?\n\n\
-	{0}
+vfs.browser.delete-confirm.message=Opravdu chcete smazat následující ?
 
 vfs.browser.delete-favorites.title=Odstranit z oblíbených
 vfs.browser.delete-favorites.message=Opravdu chcete odebrat následující soubory \
-	z oblíbených?\n\n\
-	{0}
+	z oblíbených?
 
 vfs.browser.rename.title=Přejmenovat soubor
 vfs.browser.rename.message=Zadejte nový název pro {0}:
diff --git a/org/jedit/localization/jedit_de.props b/org/jedit/localization/jedit_de.props
index f454a65..caab517 100644
--- a/org/jedit/localization/jedit_de.props
+++ b/org/jedit/localization/jedit_de.props
@@ -1,72 +1,70 @@
-# jEdit properties for localization light: GERMAN Language
-#
-#{{{
-# :folding=explicit:collapseFolds=1:noWordSep=_\\:
-# :encoding=UTF-8:
-#
-# Copyright (C) 2006-2012, Robert Schwenn <jedit at rstyx.de>
-#}}}
-#
-# Hints:
-# 1. This file is an excerpt of jedit_gui.props and contains only such properties,
-#    that represent lables for the GUI as well as mnemonics for some dialogs.
-# 2. !!! To get to main menu items via shortcuts (ALT + underlined_key) this
-#    file deactivates several alternative shortcuts!
-#    Also, some shortcuts that are unreachable on German keyboards, are changed.
-#
-#{{{ History:
-#{{{ 21.02.2012  4.4.2.3   - Core Localization separated
-#                            in order to support Localization API
-#}}}
-#}}}
-#
-#{{{ ToDo, Comments
-#
-# Translations to check again:
-#   - Dockable                => Dockbereich, Dock-Fenster, Dockfähige Fenster
-#   - Fractional font metrics => Teilschriftformen ?
-#   - Gutter                     (no translation)
-#   - Parse                      (no translation), parsen, durchsuchen
-#   - Scroll                     (no translation)
-#   - Editpane                => Editorpanel
-#
-#}}}
-#
-#{{{ Localization issues
-#
-#    {{{ General Hints:
-#        version-dependent lables:
-#        - about.title             => active version of java is not provided as {1} in jEdit 4.2
-#        - hypersearch results     => overhauled in jEdit 4.3pre15
-#    }}}
-#
-#    {{{ Missing Properties for Labels
-#
-#        There are several labels (especially dropdown-items) that are not found
-#        in the props file (and therefore translated labels cannot provided for them:
-#
-#        {{{ Global/Buffer Option panes
-#            Textarea:       - names of antiAlias modes
-#            Docking:        - names for dockable sets "all" and "core"
-#            Editing:        - names of folding modes
-#                            - names of word wrap modes
-#            Plugin Manager: - "Cache plugin list for: (minutes)"
-#            Shortcuts:      - name for "all" shortcuts
-#            Status bar:     - Tab titles "options" and "widgets"
-#                            - section header "caret position display options"
-#            View:           - names of BufferSet scopes
-#        }}}
-#
-#        {{{ Miscellaneous
-#            jEdit core      message in status bar: "xxx chars selected"
-#            Plugin Manager: Tab titles in update and install panes, All tooltips (plugin sets)
-#        }}}
-#    }}}
-#}}}
-# -------------------------------------------------------------------------------------------------
+###
+### jEdit user interface definitions: GERMAN Language
+### :tabSize=8:indentSize=8:noTabs=false:
+### :folding=explicit:collapseFolds=1:noWordSep=_\\:
+### :encoding=UTF-8:
+###
+### Copyright (C) 1998, 2005 Slava Pestov
+### German translation initiated by Robert Schwenn (jedit at rstyx.de)
+###
+###{{{ History:
+###    21.02.2012  R. Schwenn  4.4.2.3   - Core Localization separated from All-In-One
+###                                        .props file in order to support new Localization API
+###    16.12.2012  R. Schwenn  5.0.0.1   - re-built this file from scratch, means from 
+###                                        jedit_en.props (Revision 22535).
+###                                      - About 330 labels newly translated, many are new
+###                                        in jEdit 5, but some may have been missed before.
+###}}}
+###
+###{{{ Notes
+###
+###    {{{ Translations to check again:
+###        - Dockable                => Dockbereich, Dock-Fenster, Dockfähige Fenster
+###        - Fractional font metrics => Teilschriftformen ?
+###        - Gutter                     (no translation)
+###        - Parse                      (no translation), parsen, durchsuchen
+###        - Scroll                     (no translation)
+###        - Editpane                => Editorpanel
+###    }}}
+###
+###    {{{ Missing/Buggy Properties for Labels
+###
+###        {{{ Global/Buffer Option panes
+###            Textarea:       - names of antiAlias modes
+###            Docking:        - names for dockable sets "all" and "core"
+###            Editing:        - names of folding modes
+###                            - names of word wrap modes
+###                            - names of indent modes
+###            Shortcuts:      - name for "all" shortcuts
+###                            - Property "options.shortcuts.shortcut1" isn't applied
+###            Status bar:     - Tab titles "options" and "widgets"
+###                            - section header "caret position display options"
+###            View:           - names of BufferSet scopes
+###            Plugin Manager  - Property "options.plugin-manager.list-cache.minutes" isn't applied
+###        }}}
+###
+###        {{{ Miscellaneous
+###            jEdit core      - message in status bar: "xxx chars selected"
+###            Plugin Manager  - ToolTips for all 6 buttons (Plugin Set related)
+###        }}}
+###    }}}
+###}}}
+### -------------------------------------------------------------------------------------------------
 
 #{{{ jEdit core (jedit_gui.props)
 
+#{{{ Default user catalog file
+defaultCatalog=<?xml version="1.0"?>\n\
+	<!DOCTYPE MODES SYSTEM "catalog.dtd">\n\
+	\n\
+	<MODES>\n\
+	\n\
+	<!-- Für jeden neuen Bearbeitungsmodus muss ein Eintrag wie der folgende hinzugefügt werden: -->\n\
+	<!-- <MODE NAME="foo" FILE="foo.xml" FILE_NAME_GLOB="*.foo" /> -->\n\
+	\n\
+	</MODES>
+#}}}
+
 #{{{ Common strings
 common.ok=OK
 common.cancel=Abbruch
@@ -77,9 +75,16 @@ common.more=Mehr
 common.insert=Einfügen
 common.add=Hinzufügen
 common.remove=Entfernen
+common.removeCurrent=aktuelle Zuordnung entfernen
 common.moveUp=Nach oben
 common.moveDown=Nach unten
 common.clearAll=Alle löschen
+common.selectAll=Alle wählen
+common.selectNone=Nichts wählen
+
+#lineSep.unix=Unix (\\n).
+#lineSep.windows=DOS/Windows (\\r\\n).
+#lineSep.mac=MacOS (\\r).
 #}}}
 
 #{{{ Miscellaneous
@@ -91,6 +96,7 @@ action-set.macros=Makros
 action-set.plugin=Plugin: {0}
 
 macro-handler.beanshell.label=BeanShell-Skript
+#macro-handler.beanshell.glob=*.bsh
 
 save-layout-failed.message=Dock-Layout konnte nicht gespeichert werden.
 load-layout.title=Dock-Layout laden
@@ -99,357 +105,435 @@ save-layout.title=Dock-Layout speichern
 save-layout.message=Zu speicherndes Dock-Layout:
 #}}}
 
-#{{{ Menus (only menu names and special strings)
+#{{{ Tool bar
+view.search.find=Suche nach:
+view.search.close-tooltip=Suchzeile verstecken (ESCAPE)
+
+view.action.prompt=Befehl:
+view.action.no-completions=Keinen passenden Befehl gefunden
+view.action.close-tooltip=Befehlszeile verstecken (ESCAPE)
+#}}}
 
 #{{{ Context menu
 view.context.customize=Dieses Menü anpassen...
 #}}}
 
-#{{{ Menu Bar
+#{{{ System tray menu
+tray.newView.label=Neue Ansicht
+tray.newPlainView.label=Neue einfache Ansicht
+tray.exit.label=Beenden
+#}}}
+
+#{{{ Menu bar
 
 #{{{ File menu
 file.label=$Datei
+new-file.label=$Neu
+new-file-in-mode.label=Neu mit $Modus
+new-file-in-mode.dialog.title=Neue Datei
+new-file-in-mode.dialog.message=Mit Bearbeitungsmodus:
+open-file.label=Ö$ffnen...
+reload.label=Erneut $Laden
+reload-all.label=Alle erneut Laden
+close-buffer.label=S$chließen
+close-buffer.tooltip=Datei wird nur im aktiven Dateisatz geschlossen
+global-close-buffer.label=Schließen ($global)
+global-close-buffer.tooltip=Datei wird in allen Editorpanelen und Ansichten geschlossen
+closeall-except-active.tooltip=Aktiven Dateisatz leeren außer Dateien, die gerade angezeigt werden
+closeall-except-active.label=Alle ande$ren schließen
+closeall-bufferset.label=Alle schließen
+closeall-bufferset.tooltip=Alle Dateien des aktiven Dateisatzes schließen
+bufferset-toggle-exclusive.label=$Exclusive Dateisätze Ein/Aus
+bufferset-toggle-exclusive.tooltip=Wenn eine Datei geöffnet wird, soll sie in anderen nicht überlappenden Dateisätzen geschlossen werden
+close-all.label=Alle sc$hließen
+close-all.tooltip=Alle Dateien in allen Ansichten schließen.
+save.label=$Speichern
+save-as.label=Speichern $unter...
+save-a-copy-as.label=$Kopie speichern unter...
+save-a-copy-as.tooltip=... diese Kopie wird nicht geöffnet
+save-all.label=$Alle speichern
+print.label=$Drucken...
+page-setup.label=Seite $einrichten...
+# Print selection not yet implemented
+#print-selection.label=Prin$t Selection...
+exit.label=$Beenden
+
+#{{{ Recent Files menu
 recent-files.label=Let$zte Dateien
 recent-files.textfield.tooltip=Ein Filter-Präfix oder Glob-Muster kann hier eingegeben werden
 no-recent-files.label=Keine letzten Dateien
 clear-recent-files.label=Letzte Dateien löschen
+#}}}
+
 reload-encoding.label=Erneut laden mit Zeichenkodierung
 reload-encoding.error={0} ist keine gültige Zeichenkodierung
+
 #}}}
 
 #{{{ Edit menu
+
 edit.label=$Bearbeiten
+undo.label=$Rückgängig
+redo.label=$Wiederholen
+cut.label=$Ausschneiden
+copy.label=$Kopieren
+paste.label=$Einfügen
+select-all.label=A$lles auswählen
+word-count.label=W$orte zählen...
+complete-word.label=Wort $vervollständigen
+expand-abbrev.label=A$bkürzung erweitern
+goto-line.label=$Gehe zu Zeile...
+
+#{{{ More Clipboard menu
 clipboard.label=Mehr $Zwischenablage
+cut-append.label=Ausschneiden (Anfügen an Zwischenablage)
+copy-append.label=Kopieren (Anfügen an Zwischenablage)
+vertical-paste.label=$Vertikal Einfügen
+paste-previous.label=Einfügen aus zuletzt eingefügten...
+paste-deleted.label=Einfügen aus zuletzt gelöschten...
+paste-special.label=Einfügen Spezial...
+cut-string-register.label=Ausschneiden in ein Register
+copy-string-register.label=Kopieren in ein Register
+paste-string-register.label=Einfügen aus Register
+clear-string-register.label=Register löschen
+cut-append-string-register.label=Ausschneiden (Anfügen an ein Register)
+copy-append-string-register.label=Kopieren (Anfügen an ein Register)
+vertical-paste-string-register.label=Vertikal Einfügen aus Register
+view-registers.label=$Register ansehen...
+#}}}
+
+#{{{ More Selection menu
 selection.label=$Mehr Auswahl
+select-none.label=Auswahl auf$heben
+select-word.label=$Wort auswählen
+select-line.label=$Zeile auswählen
+select-paragraph.label=$Absatz auswählen
+invert-selection.label=Auswahl $umkehren
+toggle-multi-select.label=$Mehrfachauswahl Ein/Aus
+toggle-rect-select.label=$Spaltenauswahl Ein/Aus
+select-line-range.label=Zeilen$bereich auswählen...
+#}}}
+
+#{{{ Text menu
 text.label=$Text
+delete-line.label=$Zeile löschen
+delete-start-line.label=Löschen bis Zeilen$anfang
+delete-end-line.label=Löschen bis Zeil$enende
+join-lines.label=Zeilen $verbinden
+delete-paragraph.label=A$bsatz löschen
+format-paragraph.label=Absatz $formatieren
+to-lower.label=Zu $Kleinbuchstaben
+to-upper.label=Zu $Grossbuchstaben
+#}}}
+
+#{{{ Indent menu
 indent.label=Einrü$ckung
+indent-lines.label=$Ausgewählte Zeilen einrücken
+shift-left.label=Einrückung nach $links verschieben
+shift-right.label=Einrückung nach $rechts verschieben
+remove-trailing-ws.label=Leerräume an $Zeilenenden entfernen
+spaces-to-tabs.label=L$eerzeichen zu Tabulatoren
+tabs-to-spaces.label=$Tabulatoren zu Leerzeichen
+#}}}
+
+#{{{ Source menu
 source.label=$Quellkode
+range-comment.label=$Block-Kommentar
+line-comment.label=$Zeilen-Kommentar
+select-block.label=$Kode-Block auswählen
+match-bracket.label=Gehe zur $passenden Klammer
+prev-bracket.label=Gehe zur $vorigen Klammer
+next-bracket.label=Gehe zur $nächsten Klammer
+#}}}
+
 #}}}
 
 #{{{ Search menu
 search.label=$Suche
+find.label=$Suche
+find-next.label=Weitersuchen $vorwärts
+find-prev.label=Weitersuchen $rückwärts
+search-in-open-buffers.label=Suche in offenen $Dateien...
+search-in-directory.label=Suche in Ver$zeichnis...
+replace-in-selection.label=Ersetzen in Aus$wahl
+replace-and-find-next.label=$Ersetzen
+replace-all.label=$Alle ersetzen
+quick-search.label=Schne$llsuche
+hypersearch.label=Schnell-$Hypersuche
+quick-search-word.label=Schnellsuche nach W$ort
+hypersearch-word.label=HyperSuche nach Worten
+whole-word.label=Ganzes Wor$t
+ignore-case.label=Groß-/Klein-Schreibung $ignorieren
+regexp.label=Re$guläre Ausdrücke Ein/Aus
+hypersearch-results.label=Hypersuche Ergebnisse
 #}}}
 
 #{{{ Markers menu
 markers.label=$Lesezeichen
+add-marker.label=$Lesezeichen hinzufügen/entfernen
+add-marker-shortcut.label=Lesezeichen hinzufügen mit Tastaturkürzel
+remove-all-markers.label=Alle Lesezeichen $entfernen
+goto-marker.label=Gehe zu Lesezeichen
+select-marker.label=Auswählen bis Lesezeichen
+swap-marker.label=Cursor und Lesezeichen tauschen
+prev-marker.label=Gehe zum $vorigen Lesezeichen
+next-marker.label=Gehe zum $nächsten Lesezeichen
 no-markers.label=Keine Lesezeichen
+markers.blank-line=[Leerzeile]
 #}}}
 
 #{{{ Folding menu
 folds.label=$Falten
+collapse-fold.label=Falte $einklappen
+expand-one-level.label=Falte eine $Stufe ausklappen
+expand-fold.label=Falte $komplett ausklappen
+collapse-all-folds.label=A$lle Falten einklappen
+expand-folds.label=Alle Falten einer Stufe ausklappen
+expand-all-folds.label=$Alle Zeilen anzeigen
+select-fold.label=Falte aus$wählen
+add-explicit-fold.label=E$xplizite Faltung hinzufügen
+narrow-to-fold.label=Alles ausblenden außer $Falte
+narrow-to-selection.label=Alles a$usblenden außer Auswahl
+parent-fold.label=Gehe zur nächst $höheren Falte
+prev-fold.label=Gehe zur $vorigen Falte
+next-fold.label=Gehe zur $nächsten Falte
 #}}}
 
 #{{{ View menu
 view.label=$Ansicht
-scrolling.label=Sc$rollen
-splitting.label=$Teilen
-docking.label=An$docken
-buffersets.label=D$ateisätze
-#}}}
-
-#{{{ Utilities menu
-utils.label=$Extras
-recent-directories.label=$Letzte Verzeichnisse
-no-recent-dirs.label=Keine letzten Verzeichnisse
-favorites.label=Fa$voriten
-current-directory.label=$Arbeitsverzeichnis
-jedit-directory.label=$jEdit Stammverzeichnis
-settings-directory.label=$Einstellungs-Verzeichnis
-beanshell.label=Bean$Shell
-troubleshooting.label=$Troubleshooting
-quick-options.label=S$chnelleinstellungen
-#}}}
-
-#{{{ Macros menu
-macros.label=$Makros
-#}}}
-
-#{{{ Plugins menu
-plugins.label=$Plugins
-no-Plugins.label=Keine Plugins installiert
-#}}}
-
-#{{{ Help menu
-help-menu.label=$Hilfe
-#}}}
-
-#}}}
-
-#}}}
-
-#{{{ Macro Strings
-macro.temp.header=// Dies ist ein temporäres Makro. Überprüfen Sie zuerst alle Kommandos,\n\
-                  // um sicher zu gehen, dass die beabsichtigten Aktionen ausgeführt werden.\n\
-                  // Um das Makro zu starten, aktivieren Sie die Datei,\n\
-                  // in der das Makro arbeiten soll und drücken C+m C+p.
-
-macro.header=// Dies ist ein aufgenommenes Makro. Überprüfen Sie zuerst alle Kommandos,\n\
-             // um sicher zu gehen, dass die beabsichtigten Aktionen ausgeführt werden.\n\
-             // Um das Makro zu starten, aktivieren Sie die Datei,\n\
-             // in der das Makro arbeiten soll und drücken C+m C+p.
-#}}}
-
-#{{{ Commands, wether they do or do not appear in menus
-backspace-word-std.label=Löschen voriges Wort (Leerräume entfernen)
-backspace-word-std-after.label=Löschen voriges Wort (Leerräume nach dem Wort entfernen)
-backspace-word.label=Löschen voriges Wort
-backspace.label=Löschen voriges Zeichen
-delete-word-std.label=Löschen nächstes Wort (Leerräume entfernen)
-delete-word.label=Löschen nächstes Wort
-delete.label=Löschen nächstes Zeichen
-document-end.label=Gehe zum Dateiende
-document-home.label=Gehe zum Dateianfang
-end.label=Ende
-home.label=Home
-smart-end.label=Smart End
-smart-home.label=Smart Home
-insert-literal.label=Einfügen - Nächstes Zeichen als Literal
-insert-newline-indent.label=Einfügen - Zeilenumbruch und Einrückung
-insert-newline.label=Einfügen - Zeilenumbruch
-insert-tab-indent.label=Einfügen - Tabulator und Einrückung
-insert-tab.label=Einfügen - Tabulator
-line-end.label=Gehe zum Zeilenende
-line-home.label=Gehe zum Zeilenanfang
-logs-remove-all-errors.label=Alle Fehler löschen
-new-file.label=$Neu
-new-file-in-mode.label=Neu mit $Modus
-new-plain-view.label=Neue $einfache Ansicht
 new-view.label=$Neue Ansicht
-next-bracket.label=Gehe zur $nächsten Klammer
-next-buffer.label=$Gehe zur nächsten Datei
-next-char.label=Gehe zum nächsten Zeichen
-next-fold.label=Gehe zur $nächsten Falte
-next-line.label=Gehe zur nächsten Zeile
-next-marker.label=Gehe zum $nächsten Lesezeichen
-next-page.label=Gehe zur nächsten Seite
-next-paragraph.label=Gehe zum nächsten Absatz
-next-textarea.label=Gehe zum $nächsten Textbereich
-next-word-std.label=Gehe zum nächsten Wort (Leerräume entfernen)
-next-word.label=Gehe zum nächsten Wort
-open-file.label=Ö$ffnen...
-overwrite.label=Überschreib-Modus
-page-setup.label=Seite $einrichten...
-parent-fold.label=Gehe zur nächst $höheren Falte
-paste-deleted.label=Einfügen aus zuletzt gelöschten...
-paste-special.label=Einfügen Spezial...
-paste-previous.label=Einfügen aus zuletzt eingefügten...
-paste-string-register.label=Einfügen aus Register
-paste.label=$Einfügen
-prev-bracket.label=Gehe zur $vorigen Klammer
+new-view.tooltip=Neues Hauptfenster mit Dockfenstern
+new-plain-view.label=Neue $einfache Ansicht
+new-plain-view.tooltip=Neues Hauptfenster mit weniger Symbolleisten und ohne Dockfenster
+close-view.label=Ansi$cht schließen
+close-view.tooltip=Schließt das Hauptfenster. Falls es die einzige Ansicht ist, wird jEdit beendet.
 prev-buffer.label=Gehe zur $vorigen Datei
-prev-char.label=Gehe zum vorigen Zeichen
-prev-fold.label=Gehe zur $vorigen Falte
-prev-line.label=Gehe zur vorigen Zeile
-prev-marker.label=Gehe zum $vorigen Lesezeichen
-prev-page.label=Gehe zur vorigen Seite
-prev-paragraph.label=Gehe zum vorigen Absatz
-prev-textarea.label=Gehe zum v$origen Textbereich
-prev-word-std.label=Gehe zum vorigen Wort (Leerräume entfernen)
-prev-word-std-after.label=Gehe zum vorigen Wort (Leerräume nach dem Wort entfernen)
-prev-word.label=Gehe zum vorigen Wort
-print.label=$Drucken...
-quick-search-word.label=Schnellsuche nach W$ort
-quick-search.label=Schne$llsuche
-range-comment.label=$Block-Kommentar
+next-buffer.label=$Gehe zur nächsten Datei
+recent-buffer.label=Gehe zur $letzten Datei
+toggle-buffer-switcher.label=Datei-U$mschalter Ein/Aus
+focus-buffer-switcher.label=$Fokus auf Datei-Umschalter
 toggle-line-numbers.label=$Zeilennummern Ein/Aus
 toggle-statusbar.label=$Statuszeile Ein/Aus
 toggle-gutter.label=G$utter Ein/Aus
-set-view-title.label=Setze Titel für Ansicht...
+show-context-menu.label=Zeige Kontextmenü
+set-view-title.label=Titel für Ansicht setzen...
 set-view-title.tooltip=Setzt den Titel eines Hauptfensters zwecks einfacher Identifizierung auf dem Desktop
 toggle-full-screen.label=Voll$bildmodus Ein/Aus
-show-context-menu.label=Zeige Kontextmenü
-toggle-line-separator.label=Zeilenendezeichen Ein/Aus
-toggle-multi-select.label=$Mehrfachauswahl Ein/Aus
-toggle-rect-select.label=$Spaltenauswahl Ein/Aus
-toggle-word-wrap.label=Wortumbruch-Modus umschalten
-visible-end.label=Gehe zur letzten sichtbaren Zeile
-visible-home.label=Gehe zur ersten sichtbaren Zeile
-whitespace-end.label=Gehe zum Ende des Leerraumes
-whitespace-home.label=Gehe zum Beginn des Leerraumes
-scroll-down-line.label=Zeile nach $unten scrollen
-scroll-down-page.label=Seite nach u$nten scrollen
+
+#{{{ Scrolling menu
+scrolling.label=Sc$rollen
 scroll-to-current-line.label=Zur $aktiven Zeile scrollen
 scroll-and-center.label=$Scrollen und Cursor zentrieren
+center-caret.label=$Cursor im Bildschirm zentrieren
 scroll-up-line.label=Zeile nach $oben scrollen
+scroll-down-line.label=Zeile nach $unten scrollen
 scroll-up-page.label=Seite nach o$ben scrollen
-search-in-directory.label=Suche in Ver$zeichnis...
-search-in-open-buffers.label=Suche in offenen $Dateien...
-select-all.label=A$lles auswählen
-select-block.label=$Kode-Block auswählen
-select-document-end.label=Auswählen bis Datei$ende
-select-document-home.label=Auswählen bis Datei$anfang
-select-end.label=Auswählen bis Smart End Position
-select-fold.label=Falte aus$wählen
-select-home.label=Auswählen bis Smart Home Position
-select-line-end.label=Auswählen bis Zeilenende
-select-line-home.label=Auswählen bis Zeilenanfang
-select-line-range.label=Zeilen$bereich auswählen...
-select-line.label=$Zeile auswählen
-select-marker.label=Auswählen bis Lesezeichen
-select-next-bracket.label=Auswählen bis zur nächsten Klammer
-select-next-char.label=Auswählen bis zum nächsten Zeichen
-select-next-line.label=Auswählen bis zur nächsten Zeile
-select-next-marker.label=Auswählen bis zum nächsten Lesezeichen
-select-next-page.label=Auswählen bis zur nächsten Seite
-select-next-paragraph.label=Auswählen bis zum nächsten Absatz
-select-next-word-std.label=Auswählen bis zum nächsten Wort (Leerräume entfernen)
-select-next-word.label=Auswählen bis zum nächsten Wort
-select-none.label=Auswahl auf$heben
-select-paragraph.label=$Absatz auswählen
-select-prev-bracket.label=Auswählen bis zur vorigen Klammer
-select-prev-char.label=Auswählen bis zum vorigen Zeichen
-select-prev-line.label=Auswählen bis zur vorigen Zeile
-select-prev-marker.label=Auswählen bis zum vorigen Lesezeichen
-select-prev-page.label=Auswählen bis zur vorigen Seite
-select-prev-paragraph.label=Auswählen bis zum vorigen Absatz
-select-prev-word-std.label=Auswählen bis zum vorigen Wort (Leerräume entfernen)
-select-prev-word-std-after.label=Auswählen bis zum vorigen Wort (Leerräume nach dem Wort entfernen)
-select-prev-word.label=Auswählen bis zum vorigen Wort
-select-visible-end.label=Auswählen bis zur letzten sichtbaren Zeile
-select-visible-home.label=Auswählen bis zur ersten sichtbaren Zeile
-select-whitespace-end.label=Auswählen bis zum Ende des Leerraumes
-select-whitespace-home.label=Auswählen bis zum Anfang des Leerraumes
-select-word.label=$Wort auswählen
-shift-left.label=Einrückung nach $links verschieben
-shift-right.label=Einrückung nach $rechts verschieben
-# obsolete as of 4.3pre18
-show-buffer-switcher.label=Datei-U$mschalter Ein/Aus
-# new in 4.3pre18
-focus-buffer-switcher.label=$Fokus auf Datei-Umschalter
-toggle-buffer-switcher.label=Datei-U$mschalter Ein/Aus
-#
-add-buffer-to-favorites.label=Datei zu Favoriten hinzufügen
-add-dir-to-favorites.label=Verzeichnis zu Favoriten hinzufügen
-add-explicit-fold.label=E$xplizite Faltung hinzufügen
-add-marker-shortcut.label=Lesezeichen hinzufügen mit Tastaturkürzel
-add-marker.label=$Lesezeichen hinzufügen/entfernen
-close-all.label=Alle sc$hließen
-close-buffer.label=S$chließen
-close-buffer.tooltip=Datei wird nur im Dateisatz dieses Editorpanels geschlossen
-global-close-buffer.tooltip=Datei wird in allen Editorpanelen und Ansichten geschlossen
-close-docking-area.label=$Aktiven Dockbereich schließen
-close-view.label=Ansi$cht schließen
-bottom-docking-area.label=Gehe zum un$teren Dockbereich
+scroll-down-page.label=Seite nach u$nten scrollen
+#}}}
+
+#{{{ Splitting menu
+splitting.label=$Teilen
+split-horizontal.label=$Horizontal Teilen
+split-vertical.label=$Vertikal Teilen
+unsplit-current.label=Aktive $Teilung aufheben
+unsplit.label=$Alle Teilungen aufheben
+resplit.label=$Letzte Teilung wiederherstellen
+prev-textarea.label=Gehe zum v$origen Textbereich
+next-textarea.label=Gehe zum $nächsten Textbereich
+buffersets.label=D$ateisätze
+global-bufferset.label=Dateisatz-Modus => $Global
+global-bufferset.tooltip=Alle Editorpanele haben einen gemeinsamen Dateisatz
+view-bufferset.label=Dateisatz-Modus => $Ansicht
+view-bufferset.tooltip=Editorpanele innerhalb des gleichen Ansichtsfensters haben einen gemeinsamen Dateisatz
+editpane-bufferset.label=Dateisatz-Modus => $Editorpanel
+editpane-bufferset.tooltip=Jedes Editorpanel hat seinen eigenen Dateisatz
+#}}}
+
+#{{{ Docking menu
+docking.label=An$docken
+docking.menu.label=Dockfenster-Menü
+toggle-dock-areas.label=Dockbereiche $umschalten
 left-docking-area.label=Gehe zum l$inken Dockbereich
-right-docking-area.label=Gehe zum $rechten Dockbereich
 top-docking-area.label=Gehe zum $oberen Dockbereich
-toggle-dock-areas.label=Dockbereiche $umschalten
+right-docking-area.label=Gehe zum $rechten Dockbereich
+bottom-docking-area.label=Gehe zum un$teren Dockbereich
+focus-textarea.label=Gehe zum Textbereich
+close-docking-area.label=$Aktiven Dockbereich schließen
 layout-load.label=Dock-Layout $Laden ...
 layout-save.label=Dock-Layout $Speichern ...
 layout-load-current-mode.label=Dock-Layout des aktiven Modus Laden ...
 layout-save-current-mode.label=Dock-Layout des aktiven Modus Speichern ...
-about.label=ü$ber jEdit...
-action-bar.label=$Kommandozeile
+#}}}
+
+#}}}
+
+#{{{ Utilities menu
+
+utils.label=$Extras
+vfs.browser.label=Dateisystem-$Browser
+action-bar.label=$Befehlszeile
+last-action.label=Letzten Befehl $wiederholen
 buffer-options.label=$Datei-Optionen...
-center-caret.label=$Cursor im Bildschirm zentrieren
-complete-word.label=Wort $vervollständigen
-collapse-all-folds.label=A$lle Falten einklappen
-collapse-fold.label=Falte $einklappen
-copy-append-string-register.label=Kopieren (Anfügen an ein Register)
-copy-append.label=Kopieren (Anfügen an Zwischenablage)
-copy-string-register.label=Kopieren in ein Register
-copy.label=$Kopieren
-cut-append-string-register.label=Ausschneiden (Anfügen an ein Register)
-cut-append.label=Ausschneiden (Anfügen an Zwischenablage)
-cut-string-register.label=Ausschneiden in ein Register
-cut.label=$Ausschneiden
-delete-end-line.label=Löschen bis Zeil$enende
-delete-line.label=$Zeile löschen
-delete-paragraph.label=A$bsatz löschen
-delete-start-line.label=Löschen bis Zeilen$anfang
+global-options.label=Gl$obale Optionen...
+combined-options.label=$Optionen...
+
+#{{{ Recent Directories menu
+recent-directories.label=$Letzte Verzeichnisse
+no-recent-dirs.label=Keine letzten Verzeichnisse
+#}}}
+
+#{{{ Favorites menu
+favorites.label=Fa$voriten
+add-buffer-to-favorites.label=Datei zu Favoriten hinzufügen
+add-dir-to-favorites.label=Verzeichnis zu Favoriten hinzufügen
 edit-favorites.label=Favoriten bearbeiten
-edit-syntax-style.label=Syntax-Stil des Token-Typs unter dem Cursor bearbeiten
+#}}}
+
+#{{{ Current Directory menu
+current-directory.label=$Arbeitsverzeichnis
+#}}}
+
+#{{{ jEdit Home Directory menu
+jedit-directory.label=$jEdit Stammverzeichnis
+#}}}
+
+#{{{ Settings Directory menu
+settings-directory.label=$Einstellungs-Verzeichnis
+#}}}
+
+#{{{ BeanShell menu
+beanshell.label=Bean$Shell
+eval.label=BeanShell-Ausdruck $auswerten
 eval-for-selected-lines.label=BeanShell-Ausdruck auswerten - ausgewählte $Zeilen
 eval-selection.label=BeanShell-Ausdruck auswerten - Aus$wahl
-eval.label=BeanShell-Ausdruck $auswerten
-exit.label=$Beenden
-expand-abbrev.label=A$bkürzung erweitern
-expand-all-folds.label=$Alle Zeilen anzeigen
-expand-fold.label=Falte $komplett ausklappen
-expand-folds.label=Alle Falten einer Stufe ausklappen
-expand-one-level.label=Falte eine $Stufe ausklappen
-find-next.label=Weitersuchen $vorwärts
-find-prev.label=Weitersuchen $rückwärts
-find.label=$Suche
-format-paragraph.label=Absatz $formatieren
-global-options.label=Gl$obale Optionen...
-goto-line.label=$Gehe zu Zeile...
-goto-marker.label=Gehe zu Lesezeichen
-help.label=jEdit $Hilfe
-hypersearch-results.label=Hypersuche Ergebnisse
-hypersearch-word.label=HyperSuche nach Worten
-hypersearch.label=Schnell-$Hypersuche
-ignore-case.label=Groß-/Klein-Schreibung $ignorieren
-indent-lines.label=$Ausgewählte Zeilen einrücken
-invert-selection.label=Auswahl $umkehren
+#}}}
+
+#{{{ Troubleshooting menu
+troubleshooting.label=$Troubleshooting
+log-viewer.label=Activity $Log
+update-log.label=Activity Log auf $Festplatte aktualisieren
 io-progress-monitor.label=$I/O-Thread-Monitor
 task-monitor.label=T$ask-Monitor
-join-lines.label=Zeilen $verbinden
 keyboard-tester.label=$Tastatur Tester...
-last-action.label=Letzte Aktion $wiederholen
-last-macro.label=Letztes Makro $wiederholen
-line-comment.label=$Zeilen-Kommentar
-match-bracket.label=Gehe zur $passenden Klammer
 memory-status.label=$Speicher Status...
-narrow-to-fold.label=Alles ausblenden außer $Falte
-narrow-to-selection.label=Alles a$usblenden außer Auswahl
-plugin-manager.label=Plugin $Manager...
-plugin-options.label=Plugin $Optionen...
-recent-buffer.label=Gehe zur $letzten Datei
-record-macro.label=$Makro aufnehmen...
-#record-temp-macro.label=Temporäres Makro a$ufnehmen...
-record-temp-macro.label=Temp. Makro a$ufnehmen...
-redo.label=$Wiederholen
-regexp.label=Re$guläre Ausdrücke Ein/Aus
-reload-all.label=Alle erneut Laden
 reload-modes.label=$Bearbeitungsmodi neu laden
-reload.label=Erneut $Laden
-remove-all-markers.label=Alle Lesezeichen $entfernen
-remove-marker.label=Lesezeichen entfernen
-remove-trailing-ws.label=Leerräume an $Zeilenenden entfernen
-replace-all.label=$Alle ersetzen
-replace-and-find-next.label=$Ersetzen
-replace-in-selection.label=Ersetzen in Aus$wahl
-rescan-macros.label=Makro-Menü $neu aufbauen
-resplit.label=$Letzte Teilung wiederherstellen
-run-other-macro.label=$Anderes Makro ausführen...
-#run-temp-macro.label=Temporäres Makro aus$führen
-run-temp-macro.label=Temp. Makro aus$führen
-save-a-copy-as.label=$Kopie speichern unter...
-save-a-copy-as.tooltip=... diese Kopie wird nicht geöffnet
-save-all.label=$Alle speichern
-save-as.label=Speichern $unter...
-save.label=$Speichern
-spaces-to-tabs.label=L$eerzeichen zu Tabulatoren
-split-horizontal.label=$Horizontal Teilen
-split-vertical.label=$Vertikal Teilen
+#}}}
+
+#{{{ Quick options menu
+quick-options.label=S$chnelleinstellungen
+edit-syntax-style.label=Syntax-Stil des Token-Typs unter dem Cursor bearbeiten
+#}}}
+
+#}}}
+
+#{{{ Macros menu
+macros.label=$Makros
+new-macro.label=Neues Makro
+record-macro.label=$Makro aufnehmen...
 stop-recording.label=$Stop Makroaufnahme
-swap-marker.label=Cursor und Lesezeichen tauschen
-tabs-to-spaces.label=$Tabulatoren zu Leerzeichen
+last-macro.label=Letztes Makro $wiederholen
+record-temp-macro.label=Temp. Makro a$ufnehmen...
+run-temp-macro.label=Temp. Makro aus$führen
+run-other-macro.label=$Anderes Makro ausführen...
+rescan-macros.label=Makro-Menü $neu aufbauen
+no-macros.label=Keine Makros
+#}}}
+
+#{{{ Plugins menu
+plugins.label=$Plugins
+plugin-manager.label=Plugin $Manager...
+plugin-options.label=Plugin $Optionen...
+no-plugins.label=Keine Plugins installiert
+#}}}
+
+#{{{ Help menu
+help-menu.label=$Hilfe
+about.label=ü$ber jEdit...
+help.label=jEdit $Hilfe
 tip-of-the-day.label=$Tip des Tages
-to-lower.label=Zu $Kleinbuchstaben
-to-upper.label=Zu $Grossbuchstaben
-undo.label=$Rückgängig
-unsplit-current.label=Aktive $Teilung aufheben
-unsplit.label=$Alle Teilungen aufheben
-update-log.label=Activity Log auf $Festplatte aktualisieren
-vertical-paste-string-register.label=Vertikal Einfügen aus Register
-vertical-paste.label=$Vertikal Einfügen
-view-registers.label=$Register ansehen...
-word-count.label=W$orte zählen...
+userFeedback.label=Vorschlag unterbreiten...
+#}}}
 
-editpane-bufferset.label=Dateisatz-Modus => $Editorpanel
-editpane-bufferset.tooltip=Jedes Editorpanel hat seinen eigenen Dateisatz
-global-bufferset.label=Dateisatz-Modus => $Global
-global-bufferset.tooltip=Alle Editorpanele haben einen gemeinsamen Dateisatz
-view-bufferset.label=Dateisatz-Modus => $Ansicht
-view-bufferset.tooltip=Editorpanele innerhalb des gleichen Ansichtsfensters haben einen gemeinsamen Dateisatz
-closeall-except-active.label=Alle ande$ren schließen
-closeall-except-active.tooltip=Dateisatz dieses Editorpanels leeren außer Dateien, die gerade angezeigt werden
-bufferset-toggle-exclusive.label=$Exclusive Dateisätze Ein/Aus
-bufferset-toggle-exclusive.tooltip=Wenn eine Datei geöffnet wird, soll sie in anderen nicht überlappenden Dateisätzen geschlossen werden
-global-close-buffer.label=Schließen ($global)
+#}}}
+
+#{{{ Macro strings
+
+macro.temp.header=// Dies ist ein temporäres Makro. Überprüfen Sie zuerst alle Befehle,\n\
+                  // um sicher zu gehen, dass die beabsichtigten Befehle ausgeführt werden.\n\
+                  // Um das Makro zu starten, aktivieren Sie die Datei,\n\
+                  // in der das Makro arbeiten soll und drücken C+m C+p.
+
+macro.header=// Dies ist ein aufgenommenes Makro. Überprüfen Sie zuerst alle Befehle,\n\
+             // um sicher zu gehen, dass die beabsichtigten Befehle ausgeführt werden.\n\
+             // Um das Makro zu starten, aktivieren Sie die Datei,\n\
+             // in der das Makro arbeiten soll und drücken C+m C+p.
+
+#}}}
 
+#{{{ Commands that don't appear in menus
+backspace-word.label=Löschen voriges Wort
+backspace-word-std.label=Löschen voriges Wort (Leerräume entfernen)
+backspace-word-std-after.label=Löschen voriges Wort (Leerräume nach dem Wort entfernen)
+backspace.label=Löschen voriges Zeichen
+delete-word.label=Löschen nächstes Wort
+delete-word-std.label=Löschen nächstes Wort (Leerräume entfernen)
+delete.label=Löschen nächstes Zeichen
+document-end.label=Gehe zum Dateiende
+document-home.label=Gehe zum Dateianfang
+end.label=Ende
+home.label=Home
+smart-end.label=Smart End
+smart-home.label=Smart Home
+insert-literal.label=Einfügen - Nächstes Zeichen als Literal
+insert-newline.label=Einfügen - Zeilenumbruch
+insert-newline-indent.label=Einfügen - Zeilenumbruch und Einrückung
+insert-tab.label=Einfügen - Tabulator
+insert-tab-indent.label=Einfügen - Tabulator und Einrückung
+line-end.label=Gehe zum Zeilenende
+line-home.label=Gehe zum Zeilenanfang
+next-char.label=Gehe zum nächsten Zeichen
+next-line.label=Gehe zur nächsten Zeile
+next-page.label=Gehe zur nächsten Seite
+next-paragraph.label=Gehe zum nächsten Absatz
+next-word.label=Gehe zum nächsten Wort
+next-word-std.label=Gehe zum nächsten Wort (Leerräume entfernen)
+overwrite.label=Überschreib-Modus
+prev-char.label=Gehe zum vorigen Zeichen
+prev-line.label=Gehe zur vorigen Zeile
+prev-page.label=Gehe zur vorigen Seite
+prev-paragraph.label=Gehe zum vorigen Absatz
+prev-word.label=Gehe zum vorigen Wort
+prev-word-std.label=Gehe zum vorigen Wort (Leerräume entfernen)
+prev-word-std-after.label=Gehe zum vorigen Wort (Leerräume nach dem Wort entfernen)
+select-document-end.label=Auswählen bis Datei$ende
+select-document-home.label=Auswählen bis Datei$anfang
+select-end.label=Auswählen bis Smart End Position
+select-home.label=Auswählen bis Smart Home Position
+select-line-end.label=Auswählen bis Zeilenende
+select-line-home.label=Auswählen bis Zeilenanfang
+select-next-char.label=Auswählen bis zum nächsten Zeichen
+select-next-line.label=Auswählen bis zur nächsten Zeile
+select-next-page.label=Auswählen bis zur nächsten Seite
+select-next-paragraph.label=Auswählen bis zum nächsten Absatz
+select-next-word.label=Auswählen bis zum nächsten Wort
+select-next-word-std.label=Auswählen bis zum nächsten Wort (Leerräume entfernen)
+select-prev-char.label=Auswählen bis zum vorigen Zeichen
+select-prev-line.label=Auswählen bis zur vorigen Zeile
+select-prev-page.label=Auswählen bis zur vorigen Seite
+select-prev-paragraph.label=Auswählen bis zum vorigen Absatz
+select-prev-word.label=Auswählen bis zum vorigen Wort
+select-prev-word-std.label=Auswählen bis zum vorigen Wort (Leerräume entfernen)
+select-prev-word-std-after.label=Auswählen bis zum vorigen Wort (Leerräume nach dem Wort entfernen)
+select-visible-end.label=Auswählen bis zur letzten sichtbaren Zeile
+select-visible-home.label=Auswählen bis zur ersten sichtbaren Zeile
+select-whitespace-end.label=Auswählen bis zum Ende des Leerraumes
+select-whitespace-home.label=Auswählen bis zum Anfang des Leerraumes
+toggle-line-separator.label=Zeilenendezeichen Ein/Aus
+toggle-word-wrap.label=Wortumbruch-Modus umschalten
+visible-end.label=Gehe zur letzten sichtbaren Zeile
+visible-home.label=Gehe zur ersten sichtbaren Zeile
+whitespace-end.label=Gehe zum Ende des Leerraumes
+whitespace-home.label=Gehe zum Beginn des Leerraumes
 #}}}
 
 #{{{ View stuff
@@ -469,7 +553,6 @@ view.docking.menu-clone=Neues schwebendes Fenster
 view.docking.menu-close=Schließen
 view.docking.menu-undock=Abdocken + schließen
 
-# Globale Vorlage für alle Dock-Menüs
 view.docking.toggle.label={0} (Umschalten)
 view.docking.float.label={0} (Neues schwebendes Fenster)
 
@@ -521,52 +604,66 @@ view.status.swap-marker=Cursor-Position tauschen mit Lesezeichen: Kürzel? [{0}]
 view.status.vertical-paste-string-register=Vertikal einfügen aus Register ? [{0}]
 view.status.wrap-changed=Wortumbruch-Modus ist jetzt "{0}"
 view.status.wrap-tooltip=<html>Wortumbruch-Modus ist {0} (zum ändern klicken)</html>
+view.status.indent-tooltip=Indikator für Automatische Einrückung (zum ändern klicken)
+view.status.autoindent-changed=Automatische Einrückung ist jetzt "{0}"
 view.status.bufferset-tooltip=Dateisatz-Modus ist {0}
 wrap.none=ausgeschaltet
 wrap.hard=hart
 wrap.soft=weich
 #}}}
 
+#{{{ Status bar component visibility
+
+#}}}
+
 #}}}
 
 #{{{ Printing
+
+print.headerText=jEdit - {0}
+print.footerText={0} :: Seite {1}
+
 print-error.title=Fehler beim Drucken
 print-error.message=Ein Fehler trat auf beim Versuch zu drucken:\n  {0}
 #}}}
 
 #{{{ Various dialog boxes
 
-#{{{ New file in mode
-new-file-in-mode.dialog.title=Neue Datei
-new-file-in-mode.dialog.message=Mit Bearbeitungsmodus:
-#}}}
-
 #{{{ About dialog
 about.title=über jEdit
-
-# jEdit 4.2final
-#about.version=jEdit {0}
-
-# until jEdit 4.3pre16
-#about.version=jEdit {0} (verwendet Java {1})
-
-# jEdit 4.3
-#about.version=jEdit {0}, Modus: {1}, benutzt Java: {2})
-
-# jEdit 4.4
 about.version=jEdit {0}, Modus: {1}, benutzt {2} Java {3}
-
 about.mode.standalone=selbständig
 about.mode.server=Server
 about.mode.server-background=Server (bleibt im Hintergrund)
 about.navigate=Pfeil-Tasten ändern Geschwindigkeit und Richtung des laufenden Textes
-# Scrolling Text kept original.
+
+# This text scrolls by in the about dialog box.
+# Hack: Since StringTokenizer treats two consequent \n as one token, we
+# insert a space by itself in the text to create blank lines.
+about.text.prefix=jEdit wird Ihnen präsentiert von
+about.text.suffix=Ich möchte mich auch bei den Nutzern bedanken für ihre\n\
+                  	Kommentare, Reaktionen und Fehlermeldungen.
 #}}}
 
-#{{{ Error list dialog, used to report I/O and Plugin load errors
+#{{{ Error list dialog, used to report I/O and plugin load errors
 error-list.plugin-manager=Plugin Manager
 #}}}
 
+#{{{
+largeBufferDialog.title=Große Datei {0}
+largeBufferDialog.message=Die Datei ist sehr groß und jEdit könnte wegen der Syntaxhervorhebung\n\
+	nicht mehr reagieren. Sie haben die Wahl zwischen folgenden Möglichkeiten:\n\
+	-Vollständige Syntaxhervorhebung: jEdit könnte sehr langsam werden (nicht empfohlen).\n\
+	-Kontext-unabhängige Syntaxhervorhebung: jEdit's Reaktionsgeschwindigkeit wird sein wie gewohnt,\n\
+	aber die Syntaxhervorhebung wird für jede einzelne Zeile unabhängig bestimmt,\n\
+	ohne die vorige Zeile zu beachten. Sie wird deshalb fehlerhaft sein, wenn die einzelne\n\
+	Zeile zur Bestimmung nicht ausreicht (Mehrzeilige Kommentare, XML-Tags ...)\n\
+	-Keine Syntaxhervorhebung: Bearbeitungsmodus 'text' verwenden
+largeBufferDialog.fullSyntax=Vollständige Syntaxhervorhebung
+largeBufferDialog.contextInsensitive=Kontext-unabhängige Syntaxhervorhebung
+largeBufferDialog.defaultMode=Keine Syntaxhervorhebung (Bearbeitungsmodus 'text')
+#}}}
+
 #{{{ I/O error dialog box
 ioerror.title=I/O-Fehler
 ioerror.caption=Die folgenden {0} I/O-Operationen konnten nicht abgeschlossen werden:
@@ -575,7 +672,6 @@ ioerror.caption-1=Die folgende I/O-Operation konnte nicht abgeschlossen werden:
 ioerror={0}
 ioerror.directory-error=Kann Verzeichnis nicht auflisten: {0}
 ioerror.directory-error-nomsg=Kann Verzeichnis nicht auflisten.
-
 ioerror.encoding-error=Die Datei konnte nicht korrekt (ohne eventuellen Datenverlust) \n\
   geladen werden mit Zeichenkodierung "{0}".\n\
   ({1})\n\
@@ -585,7 +681,6 @@ ioerror.encoding-error=Die Datei konnte nicht korrekt (ohne eventuellen Datenver
   "Liste der Rückfall-Kodierungen" hinzu (Extras -> Globale Optionen -> Zeichenkodierungen)
 ioerror.write-encoding-error=Fehler beim Kodieren des Zeichens\n\
   {3} in Spalte {2} der Zeile {1} mit der Zeichenkodierung "{0}".
-
 ioerror.read-error=Laden nicht möglich: {0}
 ioerror.write-error=Speichern nicht möglich: {0}
 ioerror.unsupported-encoding-error={0} Zeichensatz wird durch die aktive JVM nicht unterstützt
@@ -593,12 +688,16 @@ ioerror.open-directory=Öffnen eines Verzeichnisses als Datei nicht möglich.
 ioerror.save-directory=Speichern eines Verzeichnisses als Datei nicht möglich.
 ioerror.no-read=Unzureichende Rechte, um Datei zu laden.
 ioerror.no-write=Unzureichende Rechte, um Datei zu speichern.
+ioerror.write-error-readonly=Speichern nicht möglich, Datei ist schreibgeschützt.
 ioerror.save-readonly-twostagefail=Die Datei ist schreibgeschützt und zweistufiges Speichern ist nicht möglich
 ioerror.badurl=Ungültige Schreibweise der URL: {0}
 ioerror.delete-error=Datei löschen nicht möglich.
 ioerror.rename-exists=$überschreiben der existierenden Datei "{0}" nicht möglich.
 ioerror.rename-error=Umbenennen nach "{0}" nicht möglich.
 ioerror.mkdir-error=Anlegen des Verzeichnisses nicht möglich.
+ioerror.backup-failed=Backup fehlgeschlagen. "Speichern & Backup"-Optionen prüfen!
+ioerror.backup-same-name=Dateiname für Backup ist mit dem der Originaldatei identisch.
+ioerror.copy-self=Eine zerstörende Operation (Kopieren einer Datei auf sich selbst) wurde unterbunden: {0}
 
 vfs.not-supported.list=Verzeichnisse des "{0}"-Dateisystems können nicht aufgelistet werden.
 vfs.not-supported.load=Dateien des "{0}"-Dateisystems können nicht geöffnet werden.
@@ -653,7 +752,7 @@ encoding-error.message=Die Datei "{0}"\n\
   ({2})\n\
   \n\
   Um eine andere Zeichenkodierung zu verwenden, versuchen Sie diese\n\
-  im Befehle-Menü des Dateisystem-Browser zu wählen.\n\
+  im Befehle-Menü des Dateisystem-Browsers zu wählen.\n\
   \n\
   Wenn Sie nicht wissen, welche Zeichenkodierung zu verwenden ist,\n\
   versuchen Sie "ASCII" oder "8859_1".
@@ -683,7 +782,7 @@ badurl.message=Die folgende URL ist ungültig: "{0}"\n\
 
 #{{{ Go to line dialog
 goto-line.title=Gehe zu Zeile
-goto-line.message=Gehe zu Zeile:
+goto-line.message=Gehe zu Zeile ({0} - {1}):
 #}}}
 
 #{{{ Word count dialog
@@ -784,6 +883,9 @@ search.beanshell-replace-btn=Rückgabewert eines BeanShell-Schnipsels
 search.settings=Einstellungen:
 search.keep=Dialog nicht schließen
 search.keep.mnemonic=b
+search.word=Ganzes Wort (q)
+search.word.bar=Ganzes Wort
+search.word.mnemonic=t
 search.case=Groß-/Klein ignorieren
 search.case.mnemonic=i
 search.regexp=Reguläre Ausdrücke
@@ -810,32 +912,32 @@ search.directory=Verzeichnis:
 search.directory.mnemonic=z
 search.skipHidden=keine versteckten/Backups
 search.skipBinary=keine Binärdateien
-search.skipHidden.mnemonic=p
-search.skipBinary.mnemonic=t
+search.skipHidden.mnemonic=
+search.skipBinary.mnemonic=
 
 search.directoryField=Verzeichnis:
 search.directoryField.mnemonic=c
 search.filterField=Filter:
 search.filterField.mnemonic=f
+glob.tooltip={*.c,*.h} für mehrere Extensionen
 search.subdirs=Unterverzeichnisse durchsuchen
+search.subdirs.mnemonic=u
 search.choose=wählen...
 search.choose.mnemonic=n
 search.synchronize=von aktiver Datei
 search.synchronize.mnemonic=o
-
+search.synchronize.tooltip=Übernimmt Filter und Verzeichnis von der aktiven Datei (Extension/Verzeichnis)
 search.findBtn=Suchen
-#search.findBtn.mnemonic=
+search.findBtn.mnemonic=s
 search.replaceBtn=Ersetzen
-#search.replaceBtn.mnemonic=
+search.replaceBtn.mnemonic=e
 search.replaceAndFindBtn=Ersetzen & Suchen
 search.replaceAndFindBtn.mnemonic=r
 search.replaceAllBtn=Alle ersetzen
 search.replaceAllBtn.mnemonic=a
 
-# bis jEdit 4.3pre9
-search.filterField.tooltip={*.c,*.h} für mehrere Extensionen
-# ab jEdit 4.3pre10
-glob.tooltip={*.c,*.h} für mehrere Extensionen
+# Beep when searching automatically wraps?
+
 #}}}
 
 #{{{ Keep searching dialog
@@ -844,6 +946,40 @@ keepsearching.message=Es wurden keine weiteren übereinstimmungen gefunden.\n\
  Suche am {0,choice,0#Beginn|1#Ende} fortsetzen?
 #}}}
 
+#{{{ HyperSearch results dialog
+hypersearch-results.title=HyperSuche Ergebnisse
+hypersearch-results.result-caption={0} ({1,choice,1#1 Fundstelle|1<{1,number,integer} Fundstellen in '{2,choice,1#1 Datei|1<{2,number,integer} Dateien}'})
+hypersearch-results.open=Öffnen
+hypersearch-results.open-view=Öffnen in neuer Ansicht
+hypersearch-results.open-plain-view=Öffnen in neuer, einfacher Ansicht
+hypersearch-results.open-split=Öffnen in neuer Teilansicht
+hypersearch-results.remove-node=Knoten entfernen
+hypersearch-results.new-search=Neue Suche von hier
+hypersearch-results.expand-child-nodes=Untergeordnete Knoten ausklappen
+hypersearch-results.collapse-child-nodes=Untergeordnete Knoten einklappen
+hypersearch-results.copy-to-clipboard=Kopie in Zwischenablage
+hypersearch-results.redo=Hypersuche wiederholen
+hypersearch-results.tree-view=Baumansicht umschalten
+hypersearch-results.clear.label=Alle Knoten entfernen
+hypersearch-results.stop.label=Hypersuche stoppen und bisherige Ergebnisse anzeigen
+hypersearch-results.multi.label=Mehrfachergebnisse umschalten
+hypersearch-results.highlight.label=Hervorhebungsstil für Fundstellen
+hypersearch-results.file-caption={0} ({1,choice,1#1 Fundstelle|1<{1,number,integer} Fundstellen in '{2,choice,1#1 Zeile|1<{2,number,integer} Zeilen}'})
+hypersearch-results.searching=Suchen nach "{0}"...
+hypersearch-results.no-results=Kein Ergebnis für Suche nach "{0}".
+hypersearch-results.done=Ergebnisse für Suche nach "{0}":
+
+hypersearch-status=Searching
+#}}}
+
+#{{{ HyperSearch too many results
+hypersearch.tooManyResults.label=Zu viele Ergebnisse
+hypersearch.tooManyResults.title=Zu viele Ergebnisse
+hypersearch.tooManyResults.message=Die Suche lieferte {0} \
+  Ergebnisse und ist noch nicht beendet. Soll die Suche gestoppt werden?
+#}}}
+
+
 #{{{ Search and replace error dialog
 searcherror.title=Fehler bei Suchen und Ersetzen
 # {0} - error message
@@ -866,13 +1002,6 @@ empty-fileset.message=Die angegebene Liste der zu durchsuchenden Dateien ist lee
   das Verzeichnis korrekt gesetzt sind.
 #}}}
 
-#{{{ Reverse regular expression search not supported dialog
-# obsolete as of jEdit 4.3pre16
-regexp-reverse.title=Nicht unterstützt
-regexp-reverse.message=Nach Regulären Ausdrücken kann nicht rückwärts gesucht werden.\n\
-  Entweder vorwärts suchen oder Reguläre Ausdrücke ausschalten.
-#}}}
-
 #{{{ Can only search local directories dialog
 remote-dir-search.title=Nicht-lokales Verzeichnis gewählt
 remote-dir-search.message=Sie möchten ein nicht lokal existierendes Verzeichnis durchsuchen.\n\
@@ -914,6 +1043,17 @@ selectlinerange.start=Startzeile:
 selectlinerange.end=Endzeile:
 #}}}
 
+#{{{ View registers dialog
+view-registers.title=Register
+view-registers.caption=Register:
+view-registers.clipboard=$ (Zwischenablage)
+view-registers.selection=% (Auswahl)
+view-registers.none=Keine Register definiert
+view-registers.register=Register:
+view-registers.contents=Inhalt:
+view-registers.undefined=__UNDEFINED__
+#}}}
+
 #{{{ Close all buffers dialog
 close.title=Nicht gespeicherte Änderungen
 close.caption=Die folgenden Dateien enthalten noch nicht gespeicherte Änderungen:
@@ -939,7 +1079,7 @@ files-changed.reload=Neu laden
 files-changed.reload.mnemonic=l
 files-changed.ignore=Ignorieren
 files-changed.ignore.mnemonic=i
-#}#}}}
+#}}}
 
 #{{{ Abbrev dialogs
 add-abbrev.title=Abkürzung hinzufügen
@@ -964,7 +1104,6 @@ xmode-error.title=XML Parse Fehler
 # {2} is the column number, but it's not too useful so we don't show it
 xmode-error.message=Ein Fehler trat auf beim Parsen von "{0}", Zeile {1}:\n\
   {3}
-
 xmode-error.dtd=Die DTD konnte nicht geladen werden\n({0})
 xmode-error.termchar-invalid=Der Wert des AT_CHAR-Attributes ist ungültig ({0})
 xmode-error.doctype-invalid=Erwartet wurde "MODE" als "document type", gefunden wurde "{0}"
@@ -972,12 +1111,8 @@ xmode-error.empty-tag=Das Tag "{0}" darf nicht leer sein
 xmode-error.token-invalid=Der TOKEN-Typ "{0}" ist ungültig
 xmode-error.empty-keyword=Das "keyword"-Tag darf nicht leer sein
 xmode-error.regexp=Ungültiger Regulärer Ausdruck\n({0})
-xmode-error.delegate-invalid=Ungültiges "delegate": "{0}"
-
-# until 4.3pre8
-xmode-error.hash-char-invalid=HASH_CHAR muss genau ein Zeichen sein
-# since 4.3pre9
 xmode-error.hash-char-and-hash-chars-mutually-exclusive=HASH_CHAR und HASH_CHARS sollten nicht gleichzeitig angegeben sein.
+xmode-error.delegate-invalid=Ungültiges "delegate": "{0}"
 #}}}
 
 #{{{ JARClassLoader errors
@@ -992,22 +1127,21 @@ plugin-error.load-error=Laden von "{0}" nicht möglich.\n\
 plugin-error.start-error=Fehler beim Starten: "{0}".\n\
   Versuchen Sie ein Update auf eine neuere Version des Plugins.
 plugin-error.already-loaded=Zwei Kopien installiert. Bitte entferne Sie eine der beiden Kopien.
-plugin-error.dep-jdk=Erfordert Java {0} oder höer, aber Sie haben nur Version {1}.
-plugin-error.dep-jedit=Erfordert jEdit {0} oder höer, aber Sie haben nur Version {1}.\n\
+plugin-error.dep-jdk=Erfordert Java {0} oder höher, aber Sie haben nur Version {1}.
+plugin-error.dep-jedit=Erfordert jEdit {0} oder höher, aber Sie haben nur Version {1}.\n\
   Laden Sie neue Versionen von jEdit herunter von <http://www.jedit.org>.
-plugin-error.dep-Plugin.no-version=Erfordert Version {0} \
-  oder höer von {1},\n\
-  aber {1} ist nicht installiert.
-plugin-error.dep-Plugin.broken=Erfordert {0}, aber {0}\n\
-  kann´nicht geladen werden.
-plugin-error.dep-Plugin=Erfordert Version {0} oder höer von {1}, \
-  aber Sie haben nur {1} in Version {2}.
+plugin-error.dep-plugin.no-version=Erfordert Version {0} \
+	oder später von {1},\n\
+	aber {1} ist nicht installiert.
+plugin-error.dep-plugin.broken=Erfordert {0}, aber {0}\n\
+	konnte nicht geladen werden.
+plugin-error.dep-plugin=Erfordert Version {0} oder später von {1}, \
+	aber Sie haben nur {1} Version {2}.
 plugin-error.dep-class=Erfordert die Klasse {0}.\n\
   Versuchen Sie, das erforderliche Plugin bzw. die erforderliche Klassenbibliothek zu installieren.
 plugin-error.missing-jar=Erfordert JAR-Datei "{0}".\n\
   Diese JAR-Datei ist Bestandteil dieses Plugins, kann aber nicht gefunden werden.\n\
   Versuchen Sie, dieses Plugin neu zu installieren.
-plugin-error.obsolete=Dieses Plugin ist veraltet. Bitte entfernen Sie es.
 plugin-error.not-42=Dieses Plugin unterstützt kein dynamisches Laden.\n\
   Sie müssen jEdit neu starten nach Entfernen oder Installieren dieses Plugins.
 
@@ -1063,116 +1197,49 @@ large-repeat-count.message=Möchten Sie "{0}" wirklich {1} mal ausführen?
 
 large-repeat-count.user-input.title=Große Anzahl von Wiederholungen
 large-repeat-count.user-input.message=Möchten Sie "{0}" wirklich \
-  {1} mal einfügen?
-#}}}
-
-#{{{ Wrong fold mode dialog
-folding-not-explicit.title=Ungültiger Faltmodus
-folding-not-explicit.message=Dieser Befehl kann nur mit Faltmodus "explizit" verwendet werden.
-#}}}
-
-#{{{ Memory status dialog box
-memory-status.title=Java Heap-Speicher
-memory-status.gc=Die "Garbage collection" hat {0} Kb freigegeben.
-memory-status.use={0} Kb verwendet, {1} Kb total.
-#}}}
-
-#{{{ Multiple I/O request errors
-buffer-multiple-io.title=I/O-Fehler
-buffer-multiple-io.message=Jede Datei kann nur eine Ein-/Ausgabe-Operation gleichzeitig\n\
-  ausführen. Bitte warten Sie, bis die aktive Operation\n\
-  beendet ist (oder brechen Sie diese ab mit dem I/O-Thread-Monitor),\n\
-  bevor die nächste gestartet wird.
-
-browser-multiple-io.title=I/O-Fehler
-browser-multiple-io.message=Jeder Dateisystem-Browser kann nur eine Ein-/Ausgabe-Operation\n\
-  gleichzeitig ausführen. Bitte warten Sie, bis die aktive Operation\n\
-  beendet ist (oder brechen Sie diese ab mit dem I/O-Thread-Monitor),\n\
-  bevor die nächste gestartet wird.
-#}}}
-
-#{{{ maxLineLen=0 warning
-format-maxlinelen.title=Rand für den Wortumbruch
-format-maxlinelen.message=Der Rand für den Wortumbruch muss auf einen Wert größer Null gesetzt\n\
-  werden, damit dieser Befehl funktioniert.
-#}}}
-
-#{{{ Text under caret does not have a syntax style (token type)
-syntax-style-no-token.title=Syntax-Stil Konfiguration
-syntax-style-no-token.message=Dem Text unter dem Cursor ist \
-   kein Syntax-Stil zugeordnet .
-#}}}
-
-#{{{ View title dialog
-view.title.select=Bitte einen Namen für diese Ansicht eingeben: Please enter a title for this view:
-#}}}
-
-#}}}
-
-#{{{ Dockables
-
-#{{{ HyperSearch results dialog
-hypersearch-results.title=HyperSuche Ergebnisse
-
-# bis jEdit 4.2/4.3preX: hypersearch-results.result-caption={0} ({1} Fundstellen in {2} Dateien)
-hypersearch-results.result-caption={0} ({1,choice,1#1 Fundstelle|1<{1,number,integer} Fundstellen in '{2,choice,1#1 Datei|1<{2,number,integer} Dateien}'})
-hypersearch-results.result-caption1={0} ({1} Fundstelle in {2} Datei)
-hypersearch-results.result-caption2={0} ({1} Fundstellen in {2} Datei)
-
-
-hypersearch-results.open=Öffnen
-hypersearch-results.open-view=Öffnen in neuer Ansicht
-hypersearch-results.open-plain-view=Öffnen in neuer, einfacher Ansicht
-hypersearch-results.open-split=Öffnen in neuer Teilansicht
-hypersearch-results.remove-node=Knoten entfernen
-hypersearch-results.new-search=Neue Suche von hier
-hypersearch-results.expand-child-nodes=Untergeordnete Knoten ausklappen
-hypersearch-results.collapse-child-nodes=Untergeordnete Knoten einklappen
-hypersearch-results.copy-to-clipboard=Kopie in Zwischenablage
-hypersearch-results.redo=Hypersuche wiederholen
-hypersearch-results.tree-view=Baumansicht umschalten
-hypersearch-results.clear.label=Alle Knoten entfernen
-hypersearch-results.stop.label=Hypersuche stoppen und bisherige Ergebnisse anzeigen
-hypersearch-results.multi.label=Mehrfachergebnisse umschalten
-hypersearch-results.highlight.label=Hervorhebungsstil für Fundstellen
+  {1} mal einfügen?
+#}}}
 
-## bis jEdit 4.2/4.3preX: hypersearch-results.file-caption={0} ({1} Fundstellen in {2} Zeilen)
-hypersearch-results.file-caption={0} ({1,choice,1#1 Fundstelle|1<{1,number,integer} Fundstellen in '{2,choice,1#1 Zeile|1<{2,number,integer} Zeilen}'})
-hypersearch-results.file-caption1={0} (1 Fundstelle)
-hypersearch-results.file-caption2={0} ({1} Fundstellen in 1 Zeile)
+#{{{ Wrong fold mode dialog
+folding-not-explicit.title=Ungültiger Faltmodus
+folding-not-explicit.message=Dieser Befehl kann nur mit Faltmodus "explizit" verwendet werden.
+#}}}
 
-hypersearch-results.searching=Suchen nach "{0}"...
-hypersearch-results.no-results=Kein Ergebnis für Suche nach "{0}".
-hypersearch-results.done=Ergebnisse für Suche nach "{0}":
+#{{{ Memory status dialog box
+memory-status.title=Java Heap-Speicher
+memory-status.gc=Die "Garbage collection" hat {0} Kb freigegeben.
+memory-status.use={0} Kb verwendet, {1} Kb total.
+#}}}
 
-hypersearch-status=Searching
+#{{{ Multiple I/O request errors
+buffer-multiple-io.title=I/O-Fehler
+buffer-multiple-io.message=Jede Datei kann nur eine Ein-/Ausgabe-Operation gleichzeitig\n\
+  ausführen. Bitte warten Sie, bis die aktive Operation\n\
+  beendet ist (oder brechen Sie diese ab mit dem I/O-Thread-Monitor),\n\
+  bevor die nächste gestartet wird.
 
-#{{{ HyperSearch too many results
-hypersearch.tooManyResults.label=Zu viele Ergebnisse
-hypersearch.tooManyResults.title=Zu viele Ergebnisse
-hypersearch.tooManyResults.message=Die Suche lieferte {0} \
-  Ergebnisse und ist noch nicht beendet. Soll die Suche gestoppt werden?
+browser-multiple-io.title=I/O-Fehler
+browser-multiple-io.message=Jeder Dateisystem-Browser kann nur eine Ein-/Ausgabe-Operation\n\
+  gleichzeitig ausführen. Bitte warten Sie, bis die aktive Operation\n\
+  beendet ist (oder brechen Sie diese ab mit dem I/O-Thread-Monitor),\n\
+  bevor die nächste gestartet wird.
 #}}}
 
+#{{{ maxLineLen=0 warning
+format-maxlinelen.title=Rand für den Wortumbruch
+format-maxlinelen.message=Der Rand für den Wortumbruch muss auf einen Wert größer Null gesetzt\n\
+  werden, damit dieser Befehl funktioniert.
 #}}}
 
-#{{{ Marker Viewer
-view-markers.label=Lesezeichen $ansehen
-view-markers.title=Lesezeichen
+#{{{ Text under caret does not have a syntax style (token type)
+syntax-style-no-token.title=Syntax-Stil Konfiguration
+syntax-style-no-token.message=Dem Text unter dem Cursor ist \
+   kein Syntax-Stil zugeordnet .
 #}}}
 
-#{{{ View registers
-view-registers.title=Register
-view-registers.caption=Register:
-view-registers.clipboard=$ (Zwischenablage)
-view-registers.selection=% (Auswahl)
-view-registers.none=Keine Register definiert
-view-registers.register=Register:
-view-registers.contents=Inhalt:
-# Label or constant?
-view-registers.undefined=__UNDEFINED__
+#{{{ View title dialog
+view.title.select=Bitte einen Namen für diese Ansicht eingeben:
 #}}}
-
 #}}}
 
 #{{{ Buffer options dialog
@@ -1192,47 +1259,42 @@ options.title=Optionen
 options.title-template={0}: {1}
 options.jedit.label=jEdit
 
+# Option pane to show by default
+options.last=Bearbeiten
+
+#{{{ Options groups
+
+#}}}
+
 #{{{ General pane
 options.general.label=Allgemein
 options.general.lineSeparator=Standard Zeilenendezeichen:
 options.general.encoding=Standard Zeichenkodierung:
 options.general.encodingAutodetect=Automatische Erkennung der Zeichenkodierung einer Datei, wenn möglich
-
 options.general.checkModStatus=Reaktion auf geänderte Dateien:
 options.general.checkModStatus.nothing=deaktivieren
 options.general.checkModStatus.prompt=nachfragen
 options.general.checkModStatus.reload=automatisch neu laden mit Benachrichtigung
 options.general.checkModStatus.silentReload=automatisch neu laden ohne Benachrichtigung
-
 options.general.checkModStatusUpon=Prüfung auf Änderung einer Datei bei:
 options.general.checkModStatusUpon.focus=Wechseln zu jEdit
 options.general.checkModStatusUpon.all=Wechseln zu jEdit, Ansehen der Datei oder Speichern einer Datei
-options.general.checkModStatusUpon.operations=Ansehen der Datei oder Speichern einer Datei
-options.general.checkModStatusUpon.focusBuffer=Ansehen oder Speichern der Datei
+options.general.checkModStatusUpon.visitBuffer=Ansehen der Datei
 options.general.checkModStatusUpon.none=Speichern der Datei
-
 options.general.recentFiles=Länge der Liste letzter Dateien:
 options.general.hypersearch.maxWarningResults=Maximale Anzahl Suchergebnisse für Hypersuche:
-
 options.general.sortRecent=Liste der letzten Dateien sortieren
 options.general.saveCaret=Cursor-Position merken in zuletzt verwendeten Dateien
 options.general.persistentMarkers=Lesezeichen merken
 options.general.resetUndo=Liste der rückgängig zu machenden Aktionen beim Speichern löschen
 options.general.restore=Beim Starten offene Dateien der letzten Sitzung wieder öffnen
+options.general.restore.splits=Ansichts-Einteilung wiederherstellen
 options.general.restore.remote=... einschließlich entfernter Dateien über VFS
 options.general.restore.cli=... einschließlich der auf der Befehlszeile angegebenen Dateien
-options.general.sortBuffers=Liste offener Dateien sortieren (wirksam nach Neustart von jEdit)
-options.general.sortByName=... Sortierung nach Dateinamen statt nach Verzeichnisnamen.
-options.general.newkeyhandling=Vereinfachte Tastaturbehandlung verwenden
-options.general.newkeyhandling.tooltip=(Experimentell) Einige internationale Linux-Benutzer verwenden diesen Modus, der aber bald nicht mehr verfügbar sein könnte, da die regulärere Tastaturbehandlung besser funktioniert
 options.general.encodingDetectors=Erkennungszeichen für Kodierungen:
 options.general.fallbackEncodings=Liste der Rückfall-Kodierungen:
 options.general.fallbackEncodings.tooltip=(Experimentell) Leerzeichen-getrennte Liste von Zeichenkodierungen, die bei Kodierungsfehlern während des Ladens versucht werden sollen
-
-# jedit 4.2
-options.general.confirmSaveAll=Bestätigung für "Alle Dateien speichern"
-options.general.stripTrailingEOL=Letztes Zeilenendezeichen verstecken (falls vorhanden)
-options.general.twoStageSave=Zweistufiges Speichern (Sicherer, setzt aber Dateieigentümer unter Unix zurück)
+options.general.systrayicon=jEdit-Symbol im Infobereich der Windows-Taskleiste anzeigen
 #}}}
 
 #{{{ Abbreviations pane
@@ -1249,7 +1311,7 @@ options.abbrevs.remove=Entfernen
 #{{{ Appearance pane
 options.appearance.label=Erscheinungsbild
 options.appearance.iconTheme=Icon Thema:
-options.appearance.lf.note=Look & Feel-Änderungen werden erst nach einem Neustart von jEdit wirksam.\n.
+options.appearance.fonts.antialias=Kantenglättung für Texte außerhalb des Textbereiches
 options.appearance.lf=Swing Look & Feel:
 options.appearance.primaryFont=Schrift für Schaltflächen, Menüs und Titel:
 options.appearance.secondaryFont=Schrift für Listen und Textfelder:
@@ -1267,7 +1329,10 @@ options.appearance.experimental.caption=Die folgenden drei Optionen arbeiten u.U
 options.appearance.textColors=Farben von jEdits Textbereich in allen Textkomponenten verwenden
 options.appearance.decorateFrames=Fensterränder unter Verwendung von Swing look & feel zeichnen
 options.appearance.decorateDialogs=Ränder von Dialogboxen unter Verwendung von Swing look & feel zeichnen
-options.appearance.continuousLayout.label="Continuous Layout" in geteilten Ansichten verwenden
+
+options.appearance.localization.section.label=Lokalisierung
+options.appearance.usedefaultlocale.label=Standard-Sprache verwenden
+options.appearance.lang.label=Sprache (Änderung erfordert jEdit-Neustart)
 #}}}
 
 #{{{ Context Menu pane
@@ -1277,13 +1342,13 @@ options.context.add=Hinzufügen...
 options.context.remove=Entfernen
 options.context.moveUp=Nach Oben
 options.context.moveDown=Nach Unten
+options.context.reset=Standard wiederherstellen
 options.context.add.title=Hinzufügen zum Kontextmenü
 options.context.add.caption=Hinzufügen zum Kontextmenü:
 options.context.add.separator=Trennlinie
 options.context.add.action=Befehl oder Makro:
-options.context.includeOptionsLink.label=Include "Dieses Menü anpassen..." link
+options.context.includeOptionsLink.label=Zeige Menüpunkt "Dieses Menü anpassen..."
 
-options.context.reset=Standard wiederherstellen
 options.context.reset.dialog.title=Standardmenü
 options.context.reset.dialog.message=Soll das Kontextmenü wirklich auf die Standardeinträge zurückgesetzt werden?
 #}}}
@@ -1292,10 +1357,11 @@ options.context.reset.dialog.message=Soll das Kontextmenü wirklich auf die Stan
 options.docking.label=Andocken
 options.docking.title=Fenster
 options.docking.dockPosition=Dock-Position
-options.appearance.selectFramework.label=Dockfenster-System:
+options.docking.selectFramework.label=Dock-Framework:
 options.docking.autoSaveModeLayout.label=Modus-abhängiges Dock-Layout automatisch speichern
 options.docking.autoLoadModeLayout.label=Modus-abhängiges Dock-Layout automatisch laden
 options.docking.selectSet.label=Dock-Fenster Satz:
+options.docking.system-change.note=(Experimentell) Änderung erfordert jEdit-Neustart
 #}}}
 
 #{{{ Editing pane
@@ -1323,7 +1389,20 @@ options.editing.indentSize=Einrückung Breite:
 options.editing.noWordSep=Zusätzliche Wortzeichen:
 options.editing.camelCasedWords="CamelCased" Worte trennen
 options.editing.noTabs=Soft-Tabs (Leerzeichen statt Tabulatoren einfügen)
+options.editing.elasticTabstops=Einrückung unter Verwendung elastischer Tabulatoren
+options.editing.elasticTabstops.tooltip=(Experimentell) - Könnte jEdit instabil werden lassen.
 options.editing.deepIndent=Tiefe Einrückung
+options.editing.autoIndent=Automatische Einrückung
+options.editing.largefilemode.title=Modus für große Dateien
+options.editing.largefilemode=Verhalten, wenn eine sehr große Datei geöffnet wird:
+options.editing.largefilemode.option.ask=<html><b>Fragen</b></html>
+options.editing.largefilemode.option.full=<html><b>Volle Syntaxhervorhebung</b> : \
+                jEdit könnte <b>sehr langsam</b> werden, <b>(nicht empfohlen)</b></html>
+options.editing.largefilemode.option.limited=<html><b>Kontext-unabhängige Syntaxhervorhebung</b>: <br/>\
+		Gewohnte Reaktionsgeschwindigkeit, aber schlechtere Qualität der Syntaxhervorhebung, wenn zur<br/>\
+		korrekten Darstellung mehr als eine Zeile berücksichtigt werden müsste (Mehrzeilige Kommentare, XML-Tags ...)<br/>\
+		Wortumbruch-Modus "Soft" wird auch deaktiviert<br/><b>(empfohlene Variante)</b></html>
+options.editing.largefilemode.option.nohighlight=Keine Syntaxhervorhebung, kein Wortumbruch-Modus "Soft"
 #}}}
 
 #{{{ Encodings pane
@@ -1335,17 +1414,15 @@ options.encodings.available.tooltip=<html>Zeichenkodierungen in dieser Spalte we
   Zum Aktivieren in die rechte Spalte ziehen!</html>
 options.encodings.selected.tooltip=Zeichenkodierungen in dieser Spalte werden in Zeichenkodierungs-Dialogen gelistet. \
   Zum Deaktivieren in die linke Spalte ziehen!
-options.encodings.selectAll=Alle wählen
-options.encodings.selectNone=Keine wählen
 #}}}
 
 #{{{ Gutter pane
 options.gutter.label=Gutter
 options.gutter.enabled=Gutter anzeigen
+options.gutter.optionalComponents=Optionale Gutter-Komponenten
 options.gutter.lineNumbers=Zeilennummern
 options.gutter.minLineNumberDigits=Für Zeilennummern zu reservierende Mindestanzahl Ziffern:
 options.gutter.selectionAreaEnabled=Zeilenauswahlbereich anzeigen, wenn Zeilennummern nicht angezeigt werden
-options.gutter.optionalComponents=Optionale Gutter-Komponenten
 options.gutter.selectionAreaBgColor=Auswahlbereich Hintergrundfarbe:
 options.gutter.selectionAreaWidth=Auswahlbereich Breite (in Pixel):
 options.gutter.font=Gutter Schrift:
@@ -1382,6 +1459,7 @@ options.mouse.gutter.toggle-fold-fully=Falte vollstängig ein-/ausklappen
 #{{{ Plugin Manager pane
 options.plugin-manager.label=Plugin Manager
 options.plugin-manager.updateMirrors=Liste der Update-Server
+options.plugin-manager.workthread=Liste der Update-Server wird aktualisiert ...
 options.plugin-manager.downloadSource=Plugin-Quellkode herunterladen
 options.plugin-manager.deleteDownloads=Archive im Download-Verzeichnis nach der Installation löschen
 options.plugin-manager.mirror=Bevorzugter Update-Server:
@@ -1389,6 +1467,8 @@ options.plugin-manager.location=Plugins installieren in:
 options.plugin-manager.settings-dir=jEdit Einstellungs-Verzeichnis
 options.plugin-manager.app-dir=jEdit Programm-Verzeichnis
 options.plugin-manager.none=Plugin Central Standard
+options.plugin-manager.disable-obsolete=Veraltete Plugins deaktivieren
+options.plugin-manager.list-cache.minutes=Plugin-Liste zwischenspeichern für (Minuten):
 #}}}
 
 #{{{ Printing pane
@@ -1422,32 +1502,36 @@ options.firewall.socks.port=SOCKS Proxy Port:
 
 #{{{ Save & Backup pane
 options.save-back.label=Speichern & Backup
+
 options.save-back.autosave=Auto-Speichern Intervall (Sekunden):
+options.save-back.backups=Max. Anzahl von Backups:
 options.save-back.backupDirectory=Backup Verzeichnis:
 options.save-back.backupPrefix=Backup-Präfix für Dateiname:
 options.save-back.backupSuffix=Backup-Suffix für Dateiname:
-options.save-back.backups=Max. Anzahl von Backups:
-options.save-back.confirmSaveAll=Bestätigung für "Alle Dateien speichern"
-
 options.save-back.backupEverySave=Backup bei jedem Speichern
 options.save-back.twoStageSave=Zweistufiges Speichern (Sicherer, setzt aber bei einigen Dateisystemenen den Dateieigentümer zurück)
 options.save-back.twoStageSave.tooltip=Stufe 1: Anlegen einer temporären Datei und dahinein sichern. Stufe 2: Umbenennen der temporären Datei zum wirklichen Namen
+options.save-back.confirmSaveAll=Bestätigung für "Alle Dateien speichern"
 options.save-back.autosaveUntitled=Unbenannte Dateien automatisch speichern
 options.save-back.suppressNotSavedConfirmUntitled=Unbenannte Dateien niemals als bearbeitet markieren
+options.save-back.suppressNotSavedConfirmUntitled.tooltip="EIN" bedeutet, dass der Inhalt einer unbenannten Datei überschrieben wird, wenn eine neue erzeugt wird (kein Fehler!)
 options.save-back.useMD5forDirtyCalculation=Dateien mit unverändertem Inhalt niemals als bearbeitet markieren
 options.save-back.useMD5forDirtyCalculation.tooltip=Länge und MD5-Summe der Datei im Editor und der entsprechenden Datei auf der Festplatte werden dafür verglichen.
-
-# jedit 4.2
-options.auto-back.label=Auto-Speichern & Backup
-options.auto-back.autosave=Auto-Speichern Intervall (Sekunden):
-options.auto-back.backupDirectory=Backup Verzeichnis:
-options.auto-back.backupEverySave=Backup bei jedem Speichern
-options.auto-back.backupPrefix=Backup-Präfix für Dateiname:
-options.auto-back.backupSuffix=Backup-Suffix für Dateiname:
-options.auto-back.backups=Max. Anzahl von Backups:
+options.save-back.saveAsUsesFSB="Speichern unter" startet im aktuellen Verzeichnis des Dateisystem-Browsers
 #}}}
 
 #{{{ Shortcuts pane
+options.shortcuts.deletekeymap.label=Entfernen
+options.shortcuts.deletekeymap.dialog.label=Tastenkürzelsatz entfernen
+options.shortcuts.deletekeymap.dialog.title=Entfernen
+options.shortcuts.duplicatekeymap.label=Duplizieren
+options.shortcuts.duplicatekeymap.dialog.label=Name für neuen Tastenkürzelsatz angeben
+options.shortcuts.duplicatekeymap.keymapalreadyexists.label=Der Name existiert bereits, bitte einen anderen wählen.
+options.shortcuts.duplicatekeymap.dialog.title=Tastenkürzelsatz Name
+options.shortcuts.resetkeymap.label=Zurücksetzen
+options.shortcuts.resetkeymap.dialog.label=Tastenkürzelsatz zurücksetzen
+options.shortcuts.resetkeymap.dialog.title=Tastenkürzelsatz zurücksetzen
+options.shortcuts.keymap.label=Tastenkürzelsatz wählen:
 options.shortcuts.label=Tastenkürzel
 options.shortcuts.select.label=Tastenkürzel bearbeiten:
 options.shortcuts.select.tooltip=Filter für: Eingebaute Befehle, Makros, Plugin-Befehle, Dock-Layouts
@@ -1497,10 +1581,8 @@ options.status.visible=Zeige Statuszeile
 options.status.plainview.visible=Zeige Statuszeile in einfachen Ansichten
 options.status.foreground=Statuszeile Text:
 options.status.background=Statuszeile Hintergrund:
-
 options.status.memory.foreground=Speicherindikator Vordergrund:
 options.status.memory.background=Speicherindikator Hintergrund:
-
 options.status.edit.title=Statuszeilen-Element bearbeiten
 options.status.edit.labelRadioButton=Etikett
 options.status.edit.widgetRadioButton=Widget
@@ -1511,20 +1593,7 @@ options.status.caret.dot=Zeige aktuelle Spalte der Einfügemarke
 options.status.caret.virtual=Zeige aktuelle, virtuelle Spalte der Einfügemarke
 options.status.caret.offset=Zeige Offset der Einfügemarke vom Dateianfang
 options.status.caret.bufferlength=Zeige Dateilänge
-
-#{{{ obsolete as of jedit 4.3pre14
-options.status.show-caret-status=Zeige Cursor-Status
-options.status.show-encoding=Zeige Zeichenkodierung
-options.status.show-edit-mode=Zeige Bearbeitungsmodus
-options.status.show-fold-mode=Zeige Faltmodus
-options.status.show-wrap=Zeige Wortumbruch-Modus
-options.status.show-multi-select=Zeige Mehrfachauswahl-Modus
-options.status.show-rect-select=Zeige Spaltenauswahl-Modus
-options.status.show-overwrite=Zeige Überschreib-Status
-options.status.show-line-seperator=Zeige Zeilenendezeichen
-options.status.show-memory=Zeige Speicherindikator
-options.status.show-clock=Zeige Zeit
-#}}}
+options.status.caret.title=Informationen zur Einfügemarke:
 #}}}
 
 #{{{ Syntax Highlighting pane
@@ -1540,10 +1609,12 @@ options.syntax.foldLine.0=Eingeklappte Falte, Ebene > 3
 #{{{ Text Area pane
 options.textarea.label=Textbereich
 options.textarea.font=Textstil:
-options.textarea.fontsubst=Automatisches Ersetzen der Schriftart
-options.textarea.fontsubst.tooltip=Eine passende Schriftart wird automatisch gesucht \
-  wenn die gewählte Schriftart nicht alle Zeichen darstellen kann
-options.textarea.fontsubstlist=Bevorzugte Schriftarten:
+options.textarea.fontSubst=Zusätzliche Schriftarten mit Schriftarten-Ersetzung
+options.textarea.fontSubst.tooltip=Andere Schriftarten nach Zeichen durchsuchen, die in der gewählten Schriftart fehlen (statt nur Rechtecke anzuzeigen)
+options.textarea.fontSubstList=Schriftarten-Ersetzung: Bevorzugte Schriftarten:
+options.textarea.fontSubstSystemFonts=Schriftarten-Ersetzung: Alle System-Schriftarten durchsuchen
+options.textarea.fontSubstWarning.label=Schriftarten-Ersetzung
+options.textarea.fontSubstWarning=Ohne System-Schriftarten werden bevorzugte Schriftarten benötigt.
 options.textarea.foreground=Text normal:
 options.textarea.background=Hintergrund normal:
 options.textarea.caret=Cursor:
@@ -1561,11 +1632,12 @@ options.textarea.electricBorders=Elektrische (auto scroll) Ränder
 options.textarea.stdNextPrevWord=Befehle "Gehe zu ... Wort" übergehen Leerräume
 options.textarea.antiAlias=Text mit Kantenglättung (langsam auf einigen Systemen)
 options.textarea.antiAlias.tooltip=Verlangsamt die Anzeige auf einigen Systemen.
-options.textarea.fracFontMetrics=Teilschriftformen (für bessere Textdarstellung)
+options.textarea.fracFontMetrics=Teilschriftformen
 options.textarea.fracFontMetrics.tooltip=Nicht empfohlen mit Subpixel-Kantenglättung
-options.textArea.stripTrailingEOL=Letztes Zeilenendezeichen nicht anzeigen (falls vorhanden)
-options.textArea.completeFromAllBuffers=Quelle für Wort-Vervollständigungsliste: alle offenen Dateien \
-    (Standard: alle sichtbaren Dateien)
+options.textarea.stripTrailingEOL=Letztes Zeilenende verstecken (falls vorhanden)
+options.textarea.completeFromAllBuffers=Wort-Vervollständigung von allen offenen Dateien (Standard ist \
+    die Suche auf alle gerade sichtbaren Dateien zu begrenzen)
+options.textarea.lineSpacing.label=Zusätzlicher vertikaler Zeilenabstand (in Pixel):
 #}}}
 
 #{{{ Tool Bar pane
@@ -1577,6 +1649,7 @@ options.toolbar.edit=Bearbeiten...
 options.toolbar.remove=Entfernen
 options.toolbar.moveUp=Nach Oben
 options.toolbar.moveDown=Nach Unten
+options.toolbar.reset=Standard wiederherstellen
 options.toolbar.edit.title=Symbolleistenelement bearbeiten
 options.toolbar.edit.caption=Typ:
 options.toolbar.edit.separator=Trennlinie
@@ -1586,7 +1659,6 @@ options.toolbar.edit.file=Icon laden aus Datei:
 options.toolbar.edit.choose=Wählen
 options.toolbar.edit.no-icon=Kein Icon gewählt
 
-options.toolbar.reset=Standard wiederherstellen
 options.toolbar.reset.dialog.title=Standardmenü
 options.toolbar.reset.dialog.message=Soll die Symbolleiste wirklich auf die Standardeinträge zurückgesetzt werden?
 #}}}
@@ -1594,6 +1666,7 @@ options.toolbar.reset.dialog.message=Soll die Symbolleiste wirklich auf die Stan
 #{{{ View pane
 options.view.label=Ansicht
 options.view.viewLayout=Ansichtslayout
+options.view.floatableToolbars=Frei positionierbare Symbolleisten
 options.view.alternateDockingLayout=Alternatives Dock-Layout
 options.view.alternateToolBarLayout=Alternatives Symbolleisten-Layout
 options.view.showFullPath=Zeige vollständigen Dateipfad in der Titelleiste
@@ -1606,16 +1679,11 @@ options.view.sortByName=... nach Dateiname (statt nach Pfadname)
 options.view.fullScreenIncludesMenu=Zeige Menüleiste im Vollbildmodus
 options.view.fullScreenIncludesToolbar=Zeige Symbolleiste im Vollbildmodus
 options.view.fullScreenIncludesStatus=Zeige Statuszeile im Vollbildmodus
-
-options.editpane.bufferset.default=Dateisatz-Modus für neue Editorpanele:
 options.bufferset.scope=Dateisatz-Modus:
-
-options.editpane.bufferset.contain=Neue Dateisätze enthalten:
-options.editpane.bufferset.newbufferset.copy=Kopie des aktuellen Dateisatzes
-options.editpane.bufferset.newbufferset.empty=nur eine leere Datei
-options.editpane.bufferset.newbufferset.currentbuffer=nur die aktive Datei
 #}}}
 
+
+
 #{{{ File System Browser panes
 options.browser.label=Dateisystem-Browser
 
@@ -1643,6 +1711,11 @@ options.browser.general.currentBufferFilter=Filter in Dateidialogen ist der Typ
 options.browser.general.useDefaultIcons=Standard-Icons verwenden
 #}}}
 
+#{{{ Browser Context Menu
+options.browser.custom.context.label=Kontextmenü
+options.browser.custom.context.caption=Eigene Einträge im Kontextmenü des Dateisystem-Browsers:
+#}}}
+
 #{{{ Font selector
 font-selector.title=Schriftauswahl
 font-selector.family=Schriftfamilie:
@@ -1654,7 +1727,6 @@ font-selector.italic=Kursiv
 font-selector.bolditalic=Fett Kursiv
 font-selector.preview=Vorschau
 font-selector.long-text=Zwölf Boxkämpfer jagen Viktor quer über den großen Sylter Deich.
-#font-selector.long-text=The quick brown fox jumps over the lazy dog.
 #}}}
 
 #{{{ Color chooser, used by options.syntaxs
@@ -1675,7 +1747,7 @@ style-editor.bgColor=Hintergrundfarbe:
 #{{{ Plugin options dialog
 plugin-options.title=Optionen
 options.plugins.label=Plugins
-options.no-Plugins.label=Keine Plugin-Optionen
+options.no-plugins.label=Keine Plugin-Optionen
 #}}}
 
 #{{{ Help viewer
@@ -1693,7 +1765,7 @@ helpviewer.toc.todo=ToDo-Liste und bekannte Fehler
 helpviewer.toc.copying=GNU General Public License
 helpviewer.toc.copying-doc=GNU Free Documentation License
 helpviewer.toc.copying-apache=Apache License
-helpviewer.toc.copying-Plugins=Plugin Licensing Amendment
+helpviewer.toc.copying-plugins=Plugin Lizenz-Änderung
 helpviewer.toc.plugins=Plugins
 helpviewer.toc.online-apidocs=jEdit API-Referenz (Online)
 
@@ -1708,26 +1780,20 @@ tip.title=Tip des Tages
 tip.caption=Wussten Sie schon...
 tip.show-next-time=Tips beim Starten zeigen
 tip.next-tip=Nächster Tip
+
 tip.not-found=Doc/Tips-Verzeichnis nicht gefunden
 #}}}
 
 #{{{ Activity log
 log-viewer.title=Activity Log
-log-viewer.label=Activity $Log
 log-viewer.caption=Vollständiger Log-Text ist gespeichert in {0}.
 log-viewer.copy=Kopieren
 log-viewer.tail.label=Kürzen
 #}}}
 
-#{{{ Activity log viewer
-log-viewer.dialog.title=Activity Log Einstellungen
-log-viewer.settings.label=Einstellungen
-log-viewer.message.label=Nachrichten-Anzeige:
-log-viewer.message.debug.label=Debug
-log-viewer.message.message.label=Nachricht
-log-viewer.message.notice.label=Notiz
-log-viewer.message.warning.label=Warnung
-log-viewer.message.error.label=Fehler
+#{{{ Marker Viewer
+view-markers.label=Lesezeichen $ansehen
+view-markers.title=Lesezeichen
 #}}}
 
 #{{{ I/O progress monitor
@@ -1745,22 +1811,19 @@ abort.message=Are you sure you want to abort the currently executing\n\
 
 #}}}
 
-#{{{ Task  monitor, Killring
+#{{{ Task  monitor
 task-monitor.title=Task-Monitor
-taskmanager.remainingtasks.label={0} verbleibende Aufgabe(n)
-
-killring.load-memoryerror.message=Zuvor gelöschter Text kann nicht geladen werden. Bitte HEAP-Speicherplatz erhöhen. \
-  JA drücken, um jEdit weiter zu starten, oder NEIN um abzubrechen und die Einstellungen zu ändern.
-killring.load-memoryerror.title=Speicher-Fehler
 #}}}
 
 #{{{ VFS browser
 vfs.browser.title=Datei-Browser
 vfs.browser.longtitle=Dateisystem-Browser
+vfs.browser.title.open=Dateisystem-Browser - Öffnen
+vfs.browser.title.save=Dateisystem-Browser - Speichern
+vfs.browser.title.dialog=Dateisystem-Browser - Öffnen
 vfs.browser.path=Pfad:
 vfs.browser.path.mnemonic=p
 vfs.browser.filter=Filter:
-vfs.browser.default-filter=*[^~#]
 vfs.browser.tree.loading=Laden...
 
 vfs.browser.name=Name
@@ -1776,8 +1839,10 @@ vfs.browser.status.rw=Lesen/Schreiben
 vfs.browser.size=Größe
 vfs.browser.modified=Letzte Änderung
 
+vfs.browser.file_filter.glob=Glob-Muster
+vfs.browser.file_filter.dir_only=Nur Verzeichnisse
+
 #{{{ Actions
-vfs.browser.label=Dateisystem-$Browser
 vfs.browser.browse-window.label=Browse im neuen Fenster
 vfs.browser.browse.label=Browse
 vfs.browser.close.label=Schließen
@@ -1790,6 +1855,7 @@ vfs.browser.insert.label=Einfügen
 vfs.browser.new-directory.label=Neues Verzeichnis...
 vfs.browser.new-file.label=Neue Datei
 vfs.browser.open.label=Öffnen
+vfs.browser.open-desktop.label=Öffnen mit $System-Standardprogramm
 vfs.browser.other-encoding-2.label=Andere ({0})...
 vfs.browser.other-encoding.label=Andere...
 vfs.browser.reload.label=Verzeichnis neu laden
@@ -1804,6 +1870,10 @@ vfs.browser.previous.label=Voriges Verzeichnis
 vfs.browser.next.label=Nächstes Verzeichnis
 #}}}
 
+#{{{ Tool bar
+
+#}}}
+
 #{{{ Commands menu
 vfs.browser.commands.label=Befehle
 vfs.browser.commands.encoding.label=Zeichenkodierung
@@ -1819,7 +1889,7 @@ vfs.browser.open-split.label=Neue Teilansicht
 vfs.browser.plugins.label=Plugins
 vfs.browser.plugins.plugin-manager.label=Plugin Manager...
 vfs.browser.plugins.plugin-options.label=Plugin-Optionen...
-vfs.browser.plugins.no-Plugins.label=Keine Plugins
+vfs.browser.plugins.no-plugins.label=Keine Plugins
 #}}}
 
 #{{{ Favorites menu
@@ -1843,13 +1913,11 @@ vfs.browser.recurse-favorites.title=Rekursive Favoriten...
 vfs.browser.recurse-favorites.message=Die Favoritenliste kann nicht zu sich selbst hinzugefügt werden
 
 vfs.browser.delete-confirm.title=Datei löschen
-vfs.browser.delete-confirm.message=Möchten Sie die folgenden Dateien wirklich löschen?\n\n\
-  {0}
+vfs.browser.delete-confirm.message=Möchten Sie die folgenden Dateien wirklich löschen?
 
 vfs.browser.delete-favorites.title=Löschen von Favoriten
 vfs.browser.delete-favorites.message=Möchten Sie die folgenden Dateien wirklich \
-  aus der favoritenliste löschen?\n\n\
-  {0}
+  aus der favoritenliste löschen?
 
 vfs.browser.rename.title=Datei umbenennen
 vfs.browser.rename.message=Neuer Name für {0}:
@@ -1875,9 +1943,6 @@ vfs.status.renaming=Umbenennen von {0} nach {1}
 
 plugin-manager.title=Plugin Manager
 
-plugin-manager.export-url=http://plugins.jedit.org/export/gzip_plugin_manager.php
-plugin-manager.mirror-url=http://plugins.jedit.org/export/mirror_list.php
-
 plugin-manager.hide-libraries=Bibliotheken verstecken
 
 plugin-manager.mgr-options=Download-Optionen...
@@ -1899,82 +1964,80 @@ plugin-manager.cleanup.label=Bereinigen
 plugin-manager.cleanup.title=Plugin-Daten bereinigen
 plugin-manager.cleanup.message=Daten der folgenden Plugins entfernen:
 
-plugin-manager.noOrphan.label=Find orphan
-plugin-manager.noOrphan.title=No orphan jars found
-plugin-manager.noOrphan.message=There was no orphan jars in your jEdit installation
+plugin-manager.noOrphan.label=Suche Waisen
+plugin-manager.noOrphan.title=Keine verwaisten jar-Dateien gefunden
+plugin-manager.noOrphan.message=In dieser jEdit-Installation wurden keine verwaisten jar-Dateien gefunden
 
 plugin-manager.findOrphan.label=Suche Waisen
 plugin-manager.findOrphan.title=Verwaiste jar-Dateien suchen
-plugin-manager.findOrphan.message=Die folgenden jars gehören scheinbar zu keinem Plugin\n\
+plugin-manager.findOrphan.message=Die folgenden jar-Dateien gehören scheinbar zu keinem Plugin\n\
   Entfernen?\n (VORSICHT: Sie könnten dennoch notwendig sein für ein \n\
   Plugin wie z.B. JDBC-Treiber):
 
-
-install-Plugins.depend.title=Plugin-Abhängigkeiten
-install-Plugins.depend.message=Mindestens eines der zu installierenden Plugins\n\
-  erfordert zusätzliche Plugins. Diese werden automatisch\n\
-  installiert, wenn Sie fortfahren.
+install-plugins.depend.title=Abhängigkeit erforderlich
+install-plugins.depend.message=Mindestens eins der zu installierenden Plugins erfordert\n\
+	zusätzliche Plugins. Sie werden automatisch installiert.
 
 plugin-manager.status.loaded=Geladen
+plugin-manager.status.disabled=Nicht unterstützt
 plugin-manager.status.not-loaded=Nicht geladen
 plugin-manager.status.error=Fehler
 
 plugin-manager.list-download-connect=Verbinde mit plugins.jedit.org
 plugin-manager.list-download=Plugin-Liste wird heruntergeladen von Plugins.jedit.org
+plugin-manager.list-download.mirror-autoselect-error.title=Fehler bei Auswahl des Update-Servers
+plugin-manager.list-download.mirror-autoselect-error.message=Fehler bei automatischer Auswahl des Update-Servers:\n\
+	{0}\n\
+	Es könnte helfen, einen specifischen Server zu wählen.
+plugin-manager.list-download.need-password.title=HTTP-Proxy benötigt ein Password
+plugin-manager.list-download.need-password.message=HTTP-Proxy benötigt ein Password.\n\
+        Bitte gültigen Benutzername und gültiges Password in "Download-Optionen" angeben.
+plugin-manager.list-download.disconnected.title=Fehler beim Herunterladen der Plugin-Liste
+plugin-manager.list-download.disconnected.message=Die Plugin-Liste kann nicht heruntergeladen werden:\n\
+        Host {0} ist nicht verfügbar. Eventuell sollten Sie Ihre Internetverbindung prüfen...
+plugin-manager.list-download.generic-error.title=Fehler beim Herunterladen der Plugin-Liste
+plugin-manager.list-download.generic-error.message=Fehler beim Herunterladen der Plugin-Liste:\n\
+        Fehler ist {0} - {1}
 plugin-manager.filterField=Nur Plugins anzeigen, deren Namen diesen Text enthalten
 
-#{{{ Error while loading Plugin list
-# obsolete as of jEdit 4.4.1
-plugin-list.ioerror.title=I/O-Fehler
-plugin-list.ioerror.message=Plugin-Liste kann nicht heruntergeladen werden.\n\
-  ({0})\n\
-  \n\
-  Wenn Ihr Rechner hinter einem HTTP- oder SOCKS-Proxy steht,\n\
-  klicken Sie "Proxy-Server", um den Proxy zu konfigurieren\n\
-  und versuchen Sie es noch einmal.
-plugin-list.ioerror.proxy-servers=Proxy-Server...
-
-plugin-list.xmlerror.title=XML-Parser-Fehler
-plugin-list.xmlerror.message=Ein Fehler trat auf beim Parsen von {0}, in Zeile {1}:\n\
-  {2}
-#}}}
-
 #{{{ Plugin management
-manage-Plugins.title=Verwalten
+manage-plugins.title=Verwalten
 
-manage-Plugins.info.name=Name
-manage-Plugins.info.version=Version
-manage-Plugins.info.status=Status
+manage-plugins.info.name=Name
+manage-plugins.info.version=Version
+manage-plugins.info.status=Status
 manage-plugins.info.data=Daten
 
 manage-plugins.data-size.unknown=<unbekannt>
 
-
 manage-plugins.remove=Entfernen...
 manage-plugins.help=Hilfe...
+plugin-load-error.message=Plugin kann nicht geladen werden
+plugin-load-error.title=Plugin Ladefehler
 #}}}
 
 #{{{ Plugin installation
-install-Plugins.title=Installation
+install-plugins.title=Installieren
 
-install-Plugins.info.name=Name
-install-Plugins.info.size=Größe
+install-plugins.info.name=Name
+install-plugins.info.size=Größe
 install-plugins.info.releaseDate=Release-Datum
-install-Plugins.info.version=Version
-install-Plugins.info.category=Kategorie
+install-plugins.info.version=Version
+install-plugins.info.category=Kategorie
 
-install-Plugins.totalSize=Gesamtgröße:\u0020
-install-Plugins.select-all=Alle wählen
-install-Plugins.install=Installieren
-install-Plugins.show-updates=Updates zeigen
+install-plugins.totalSize={0} Plugin(s), Gesamtgröße: {1}
+install-plugins.select-all=Alle wählen
+install-plugins.install=Installieren
+install-plugins.show-updates=Updates anzeigen
 
-install-Plugins.info=<b>Autor</b>: {0}\n\
-  <b>Fertiggestellt</b>: {1}\n\
-  {2}
+install-plugins.info=<b>Autor</b>: {0}\n\
+	<b>Release</b>: {1}\n\
+	{2}
 
-update-Plugins.title=Update
+update-plugins.title=Aktualisieren
 
 plugin-manager.progress=Gewählte Plugins werden heruntergeladen von Plugins.jedit.org...
+plugin-manager.progress.title=Plugins werden installiert
 plugin-manager.progress.stop=Stop
 #}}}
 
@@ -2001,33 +2064,69 @@ fileprop.selectedFiles=Gewählte Dateien
 fileprop.selectedDirectories=Gewählte Verzeichnisse
 #}}}
 
-#{{{ gnu.regexp
-# (obsolete since replaced with java native regexp???)
-# Prefix for REException messages
-error.prefix=An Position {0} im Regulären Ausdruck:
+#{{{ Activity log viewer
+log-viewer.dialog.title=Activity Log Einstellungen
+log-viewer.settings.label=Einstellungen
+log-viewer.message.label=Nachrichten-Anzeige:
+log-viewer.message.debug.label=Debug
+log-viewer.message.message.label=Nachricht
+log-viewer.message.notice.label=Notiz
+log-viewer.message.warning.label=Warnung
+log-viewer.message.error.label=Fehler
+# This one should be actually placed in Debugging options, but
+# we don't have such a pane yet
+debug.beepOnOutput.label=Pies bei neuem Eintrag
+#}}}
+
+logs-remove-all-errors.label=Alle Fehler löschen
 
-# REException (parse error) messages
-repeat.assertion=Wiederholungsangabe ohne vorangehenden Bezeichner
-repeat.chained=Mehrfache Wiederholungsangabe für einen Bezeichner
-repeat.no.token=Quantifizierer (?*+{}) ohne vorangehenden Bezeichner
-repeat.empty.token=Bezeichner mit Wiederholungsangabe ist vielleicht leer
-unmatched.brace=Unvollständiges Paar geschweifter Klammern
-unmatched.bracket=Unvollständiges Paar eckiger Klammern
-unmatched.paren=Unvollständiges Paar runder Klammern
-interval.no.end=Ende des Intervalles erwartet
-class.no.end=Ende der Zeichenklasse erwartet
-subexpr.no.end=Ende des Subausdrucks erwartet
-interval.order=Intervall Minimum ist größer als Maximum
-interval.error=Intervall ist leer oder enthält ungültige Zeichen
-ends.with.backslash=Backslash am Ende des Musters
+taskmanager.remainingtasks.label={0} verbleibende Aufgabe(n)
 
-# RESyntax message
-syntax.final=Die Syntax wurde für endgültig erklärt und kann nicht geändert werden.
+#{{{ Statusbar Widgets
+# the widgets should have a label and a sample.
+# the label is displayed when choosing the list of widgets
+# the sample is an example of what the widget will show, for the
+# preview in the options
+statusbar.mode.label=Datei Bearbeitungsmodus (z.B.: java)
+#statusbar.mode.sample=java
+statusbar.fold.label=Datei Faltmodus (z.B.: explicit)
+#statusbar.fold.sample=explicit
+statusbar.encoding.label=Datei Zeichenkodierung (z.B.: UTF-8)
+#statusbar.encoding.sample=UTF-8
+statusbar.wrap.label=Datei Wortumbruch-Modus (z.B.: N)
+#statusbar.wrap.sample=N
+statusbar.indent.label=Automatische Einrückung (z.B.: F)
+#statusbar.indent.sample=F
+statusbar.multiSelect.label=Datei Mehrfachauswahl-Modus (z.B.: m)
+#statusbar.multiSelect.sample=m
+statusbar.rectSelect.label=Datei Spaltenauswahl-Modus (z.B.: r)
+#statusbar.rectSelect.sample=r
+statusbar.overwrite.label=Datei Überschreib-Modus (z.B.: o)
+#statusbar.overwrite.sample=o
+statusbar.lineSep.label=Datei Zeilenendezeichen (z.B.: U)
+#statusbar.lineSep.sample=U
+statusbar.memory-status.label=Speicherstatus (z.B.: 9/24Mb)
+#statusbar.memory-status.sample=9/24Mb
+statusbar.clock.label=Uhrzeit (z.B.: 16:45)
+#statusbar.clock.sample=16:45
+statusbar.buffersets.label=Dateisatz-Modus (z.B.: G)
+#statusbar.buffersets.sample=G
+statusbar.selection-length.label=Zeichenanzahl in Auswahl (z.B.: 192)
+#statusbar.selection-length.sample=192
+statusbar.last-modified.label=Datum der letzen Änderung auf Festplatte (z.B.: 12.03.11 16:43)
+statusbar.last-modified.sample=12.03.11 16:43
+statusbar.task-monitor.label=Task-Monitor (z.B.:  7 Aufgabe(n))
+statusbar.task-monitor.tooltip=Klicken, um das Task-Monitor-Dockfenster zu öffnen
+statusbar.task-monitor.sample=7 Aufgabe(n)
+statusbar.task-monitor.template={0} Aufgabe(n)
 #}}}
 
-#{{{ Keymap Labels
-keymaps.German_Keyboard.label=Deutsche Tastatur
-#}}}
+killring.load-memoryerror.message=Zuvor gelöschter Text kann nicht geladen werden. Bitte HEAP-Speicherplatz erhöhen. \
+  JA drücken, um jEdit weiter zu starten, oder NEIN um abzubrechen und die Einstellungen zu ändern.
+killring.load-memoryerror.title=Speicher-Fehler
+killring.start=Start
+killring.stop=Stop
+killring.delete=killring.xml löschen und starten
 
 #}}}
 
@@ -2040,6 +2139,250 @@ macro.rs.general.ErrorNotEditableDialog.title=schreibgeschützt
 macro.rs.general.ErrorNotEditableDialog.message=Datei kann nicht bearbeitet werden!
 #}}}
 
+#{{{ Clipboard
+
+#{{{ Copy Lines Containing
+macro.rs.CopyLinesContaining.CopyLinesContaining.label=Zeilen kopieren, die folgenden Text enthalten:
+macro.rs.CopyLinesContaining.LinesCopied.message=Zeile(n) kopiert
+#}}}
+
+#{{{ Cut Lines Containing
+macro.rs.CutLinesContaining.CutLinesContaining.label=Zeilen ausschneiden, die folgenden Text enthalten:
+macro.rs.CutLinesContaining.LinesCut.message=Zeile(n) ausgeschnitten
+#}}}
+
+#}}}
+
+#{{{ Editing
+
+#{{{ Go to column
+macro.rs.GoToColumn.ColumnBefore.label=Spalte (zwischen 1 und
+macro.rs.GoToColumn.ColumnAfter.label=):
+#}}}
+
+#{{{ Key Words to Uppercase
+macro.rs.KeywordsToUpperCase.ConvertedKeywords.message=zu Großbuchstaben konvertierte Schlüsselworte
+#}}}
+
+#{{{ Mode Switcher
+macro.rs.BufferModeSwitcher.MainDialog.title=Bearbeitungsmodus wechseln
+macro.rs.BufferModeSwitcher.EnterBufferMode.label=Bearbeitungsmodus eingeben:
+macro.rs.BufferModeSwitcher.ChangingBufferMode.label=Bearbeitungsmodus ändern
+macro.rs.BufferModeSwitcher.To.label=nach
+macro.rs.BufferModeSwitcher.Mode.label=Modus
+macro.rs.BufferModeSwitcher.NotFound.label=Nicht gefunden
+#}}}
+
+#{{{ Moves Lines Down - Move Lines Up
+macro.rs.MoveLines.NoMultipleSelection.error=Dieses Makro funktioniert nicht mit Mehrfachauswahl.
+#}}}
+
+#}}}
+
+#{{{ Files
+
+#{{{ Browse Directory
+macro.rs.BrowseDirectory.DirectoryBrowse.label=Aufzulistendes Verzeichnis:
+#}}}
+
+#{{{ Buffer Switcher
+macro.rs.BufferSwitcher.OpenBuffers.label=Offene Dateien
+macro.rs.BufferSwitcher.QuickHelp.label=[ENTER] aktivieren; [LEER] aktivieren, Dialog halten; [ENTF] Datei schließen
+macro.rs.BufferSwitcher.Help1.label=Hilfe für Dateiwechsler-Makro:
+macro.rs.BufferSwitcher.Help2.label=ENTFERNEN  schließt die gewählte Datei.
+macro.rs.BufferSwitcher.Help3.label=ENTER  aktiviert die gewählte Datei, schließt den Dialog.
+macro.rs.BufferSwitcher.Help4.label=ESCAPE  schließt den Dialog.
+macro.rs.BufferSwitcher.Help5.label=LEERTASTE  aktiviert die gewählte Datei, schließt den Dialog nicht.
+macro.rs.BufferSwitcher.Help6.label=HINWEIS:  Dieser Dialog erscheint nur einmal.
+#}}}
+
+#{{{ Delete Current
+macro.rs.DeleteCurrent.NotOnDisk.error=Datei existiert nicht auf der Festplatte.
+macro.rs.DeleteCurrent.DeleteNotSupport.error=Löschen wird nicht unterstützt
+macro.rs.DeleteCurrent.Deleted.message=Gelöscht:
+#}}}
+
+#{{{ Glob Close
+macro.rs.GlobClose.GlobPattern.label=Glob-Muster (z.B. *.txt oder /usr/include/*):
+macro.rs.GlobClose.ErrorGlobPattern.error=Fehler im Glob-Muster:
+#}}}
+
+#{{{ Next Dirty Buffer
+macro.rs.NextDirtyBuffer.NoOtherBufferDirty.message=Keine anderen Dateien sind geändert
+macro.rs.NextDirtyBuffer.NoBufferDirty.message=Keine Dateien sind geändert
+#}}}
+
+#{{{ open Path
+macro.rs.OpenPath.PathName.label=Pfadname:
+#}}}
+
+#{{{Toggle ReadOnly
+macro.rs.ToggleReadOnly.OnlyLocalFiles.error=Dieses Makro funktioniert nur mit lokalen Dateien
+macro.rs.ToggleReadOnly.OnlyWindowsUnixMacos.error=Dieses Makro funktioniert nur unter Windows, Unix und MacOS X.
+#}}}
+
+#}}}
+
+#{{{ Interface
+
+#{{{ Decrease Font Size - Increase Font Size
+macro.rs.ChangeFontSize.FontSize.message=Schriftgröße jetzt:
+#}}}
+
+#}}}
+
+#{{{ Java
+
+#{{{ Create Constructor
+macro.rs.CreateConstructor.UnevenNumber.message=Unpassende Anzahl von Typnamen und Variablen
+#}}}
+
+#{{{ Get Package Name
+macro.rs.GetPackageName.NotWorking1.error=Dieses Makro funktioniert nicht wenn der Java-Interpreter
+macro.rs.GetPackageName.NotWorking2.error=jEdit mit der '-jar' Befehlszeilen-Option lädt.
+macro.rs.GetPackageName.NotFind.error=Konnnte keinen Package-Namen finden
+#}}}
+
+#{{{ Java File Save
+macro.rs.JavaFileSave.InfiniteLoop.error=Endlos-Schleife:
+#}}}
+
+#{{{Make Get and Set Methods
+macro.rs.MakeGetAndSetMethods.GenerateCode.label=Generiere Kode
+macro.rs.MakeGetAndSetMethods.CreateGetMethods.label=Erzeuge Get-Methoden
+macro.rs.MakeGetAndSetMethods.CreateSetMethods.label=Erzeuge Set-Methoden
+macro.rs.MakeGetAndSetMethods.CreateGetandSetMethods.label=Erzeuge Get- und Set-Methoden
+#}}}
+
+#}}}
+
+#{{{ Misc
+
+#{{{ Buffer to HyperSearch Results - HyperSearch Results to Buffer
+macro.rs.HyperSearchResults.WindowNotOpen.error=Das Dockfenster 'HyperSuche Ergebnisse' ist nicht offen.
+macro.rs.HyperSearchResults.NotMatch.error=Keine Ergebnisse der HyperSuche
+#}}}
+
+#{{{ Debug BufferSets
+#macro.rs.DebugBuffersets.BuffersetDebugging.label=BUFFERSET DEBUGGING
+#macro.rs.DebugBuffersets.BufferCount.label=BufferCount:
+#macro.rs.DebugBuffersets.BufferList.label=BUFFER LIST
+#macro.rs.DebugBuffersets.EndBufferList.label=END BUFFER LIST
+#macro.rs.DebugBuffersets.EditpaneList.label=EDITPANE LIST
+#macro.rs.DebugBuffersets.EndEditpaneList.label=END EDITPANE LIST
+#}}}
+
+#{{{ Display Abbreviations
+macro.rs.DisplayAbbreviations.Abbreviation.label=Abkürzung
+macro.rs.DisplayAbbreviations.Expansion.label=Erweiterung
+macro.rs.DisplayAbbreviations.Close.label=Schließen
+macro.rs.DisplayAbbreviations.WriteSet.label=Satz schreiben
+macro.rs.DisplayAbbreviations.WriteAll.label=Alle schreiben
+macro.rs.DisplayAbbreviations.AbbreviationList.label=Liste der Abkürzungen
+macro.rs.DisplayAbbreviations.CallingWTTNB.label=Aufruf writeTableToNewBuffer für
+macro.rs.DisplayAbbreviations.SizeVector.label=Größe des Vectors:
+macro.rs.DisplayAbbreviations.jEditAbbreviationTable.label=jEdit Tabelle der Abkürzungen
+macro.rs.DisplayAbbreviations.AbbreviationSet.label=Abkürzungssatz:
+macro.rs.DisplayAbbreviations.AbbreviationExpansion.label=Abkürzung    Erweiterung
+macro.rs.DisplayAbbreviations.NoAbbreviations.label=<< Keine Abkürzungen >>
+#}}}
+
+#{{{ Display Actions
+macro.rs.DisplayActions.jEditActionBar1.label=Der Aufruf der jEdit-Befehlszeile kann via Extras-Menü erfolgen und
+macro.rs.DisplayActions.jEditActionBar2.label=ist normalerweise dem Tastenkürzel C+ENTER zugeordnet
+macro.rs.DisplayActions.NoLabel.label=<keine Beschriftung>
+#}}}
+
+#{{{ Display Character Code
+macro.rs.DisplayCharacterCode.CharacterAtCaret.label=Zeichen an der Einfügemarke:
+#}}}
+
+#{{{ Display Shorcuts
+macro.rs.DisplayShortcuts.jEditShortcutTable.label=jEdit Tastenkürzel-Tabelle
+macro.rs.DisplayShortcuts.Name.label=Befehl
+macro.rs.DisplayShortcuts.Shortcut1.label=Tastenkürzel - 1
+macro.rs.DisplayShortcuts.Shortcut2.label=Tastenkürzel - 2
+macro.rs.DisplayShortcuts.Close.label=Schließen
+macro.rs.DisplayShortcuts.WriteToBuffer.label=Schreibe in Datei
+macro.rs.DisplayShortcuts.ShortcutList.label=Liste der Tastenkürzel
+#macro.rs.DisplayShortcuts.Center.label=Center
+#macro.rs.DisplayShortcuts.South.label=South
+#}}}
+
+#{{{ Hex Convert
+macro.rs.HexConvert.Before.label=vorher:
+macro.rs.HexConvert.After.label=nachher:
+macro.rs.HexConvert.NotValidHex.label=ist keine gültige Hexadezimal-Angabe
+macro.rs.HexConvert.ByteToString.label=Byte in Zeichenkette:
+#}}}
+
+#{{{ Make Bug Report
+macro.rs.MakeBugReport.OpeningActivityLog.error=Fehler beim Öffnen des Activity Log.
+macro.rs.MakeBugReport.UsefulEntriesForReport.label=Einträge des Activity log, die für die Fehlermeldung nützlich sein könnten:\n\n.
+#macro.rs.MakeBugReport.MessagejEdit.label=[message] jEdit:
+#macro.rs.MakeBugReport.NoticejEdit.label=[notice] jEdit:
+#macro.rs.MakeBugReport.NoticeJarClassLoader.label=[notice] JARClassLoader:
+#macro.rs.MakeBugReport.MessagejEditStartupComplete.label=[message] jEdit: Startup complete
+#macro.rs.MakeBugReport.Error.label=[error]
+macro.rs.MakeBugReport.ReadingActivityLog.error=Fehler beim Lesen des Activity Log.
+#}}}
+
+#{{{ Run Script
+macro.rs.RunScript.SpecifyParametersForRunning.label=Parameter für Skriptstart unter
+macro.rs.RunScript.ScriptExecutionCancelled.message=Skriptausführung wurde abgebrochen
+macro.rs.RunScript.FileNotScript.error=Die aktive Datei scheint kein Skript zu sein.
+#}}}
+
+#{{{ Show Threads
+macro.rs.ShowThreads.Daemon.label=Dienst
+macro.rs.ShowThreads.Priority.label=Priorität
+macro.rs.ShowThreads.NotStarted.label=nicht gestartet
+macro.rs.ShowThreads.Interrupted.label=unterbrochen
+macro.rs.ShowThreads.CloseUpdate.label=[Esc] Schließen      [U] Aktualisieren
+macro.rs.ShowThreads.CurrentThreads.label=Aktuelle Threads
+#}}}
+
+#}}}
+
+#{{{ Properties
+
+#{{{ Insert Buffer Properties
+macro.rs.InsertBufferProperties.InsertLocalProperties.label=Lokale Dateieigenschaften einfügen
+macro.rs.InsertBufferProperties.Properties.label=Eigenschaften:
+macro.rs.InsertBufferProperties.Insert.label=Einfügen
+macro.rs.InsertBufferProperties.MustBeIn10Lines.message=Hinweis: Lokale Dateieigenschaften müssen in den ersten oder letzten 10 Zeilen der Datei stehen, um durch jEdit erkannt zu werden.
+#}}}
+
+#{{{ Look and Feel Properties
+macro.rs.LookAndFeelProperties.Listing.label=-- Liste der Look&Feel Eigenschaften-Namen--
+#}}}
+
+#{{{ System Properties
+macro.rs.SystemProperties.SystemProperties.label=System Eigenschaften
+#}}}
+
+#}}}
+
+#{{{ Text
+
+#{{{ Add Prefix And Suffix
+macro.rs.AddPrefixAndSuffix.MainDialog.title=Gewählte Zeilen mit Präfix und Suffix versehen
+macro.rs.AddPrefixAndSuffix.PrefixToAdd.label=Präfix:
+macro.rs.AddPrefixAndSuffix.SuffixToAdd.label=Suffix:
+#}}}
+
+#{{{ Color Picker
+macro.rs.ColorPicker.ColorPicker.label=Farbauswahl-Feld
+#}}}
+
+#{{{ Insert Date
+macro.rs.InsertDate.InternetTime.label=Internet-Zeit
+#}}}
+
+#{{{ Insert Tag
+macro.rs.InsertTag.EnterNameTag.label=Tag-Namen eingeben:
+#}}}
+
 #{{{ Line_Filter
 macro.rs.LineFilter.MainDialog.title=Zeilenfilter
 macro.rs.LineFilter.ignoreCaseCheckBox.label=Groß-/Kleinschreibung ignorieren
@@ -2060,14 +2403,22 @@ macro.rs.LineFilter.SummaryWritten.label=Zeile(n) in neue Datei geschrieben
 
 macro.rs.LineFilter.ErrorRegexpDialog.title=Ungültiger Regulärer Ausdruck
 macro.rs.LineFilter.ErrorRegexpDialog.message=Der Reguläre Ausdruck ist ungültig!
+#}}}
+
+#{{{ Next Char
+macro.rs.InsertTag.EnterCharacter.label=Zeichen eingeben
+#}}}
+
+#{{{ Reverse Lines
+macro.rs.ReverseLines.NotWorkingRectangularSelection.error=Dieses Makro funktioniert leider nicht mit Spaltenauswahl.
+#}}}
+
+#{{{ Single Space Buffer
+macro.rs.SingleSpaceBuffer.NotDoubleSpaced.message=scheint nicht "zweizeilig" zu sein:
+macro.rs.SingleSpaceBuffer.Line.message=Zeile
+macro.rs.SingleSpaceBuffer.NotBlank.message=ist nicht leer.
+#}}}
 
-# obsolete as of version 1.3
-macro.rs.LineFilter.ErrorNotEditableDialog.title=schreibgeschützt
-macro.rs.LineFilter.ErrorNotEditableDialog.message=Datei kann nicht bearbeitet werden!
-macro.rs.LineFilter.processModeRadioButton1.label=passend
-macro.rs.LineFilter.processModeRadioButton2.label=nicht passend
-macro.rs.LineFilter.actionModeRadioButton1.label=Schreiben in neue Datei
-macro.rs.LineFilter.actionModeRadioButton2.label=Löschen
 #}}}
 
 #}}}
@@ -2075,11 +2426,15 @@ macro.rs.LineFilter.actionModeRadioButton2.label=Löschen
 #{{{ Macro Names for Macros Menu (only original macros in original folders!)
 
 #{{{ C
+macros.folder.C.label=C
+
 C/Include_Guard.label=Include Wächter
 C/Toggle_Header_Source.label=Wechseln zwischen Quelle und Header
 #}}}
 
 #{{{ Clipboard
+macros.folder.Clipboard.label=Zwischenablage
+
 Clipboard/Copy_Lines.label=Kopiere Zeilen
 Clipboard/Copy_Lines_Containing.label=Kopiere Zeilen (Filter nach Inhalt)
 Clipboard/Copy_Visible_Lines.label=Kopiere sichtbare Zeilen
@@ -2089,11 +2444,10 @@ Clipboard/Paste_Indent.label=Einfügen mit Einrückung
 #}}}
 
 #{{{ Editing
+macros.folder.Editing.label=Bearbeiten
+
 Editing/Duplicate_Lines_Above.label=Dupliziere Zeilen nach oben
 Editing/Duplicate_Lines_Below.label=Dupliziere Zeilen nach unten
-Editing/Emacs_Ctrl-K.label=Emacs Ctrl-K
-Editing/Emacs_Next_Line.label=Emacs Nächste Zeile
-Editing/Emacs_Previous_Line.label=Emacs Vorige Zeile
 Editing/Go_to_Column.label=Gehe zu Spalte
 Editing/Greedy_Backspace.label=Gefräßig Löschen nach links
 Editing/Greedy_Delete.label=Gefräßig Löschen
@@ -2108,7 +2462,35 @@ Editing/Open_Line_Below.label=Leerzeile einfügen unten
 Editing/Toggle_Fold.label=Falte ein-/ausklappen
 #}}}
 
+#{{{ Emacs
+macros.folder.Emacs.label=Emacs
+Emacs/Emacs_Align_Decls.label=Emacs Dezimalzahlen ausrichten
+Emacs/Emacs_Backward_Sentence.label=Emacs Satz rückwärts
+Emacs/Emacs_Capitalize_Word.label=Emacs Wort zu Kapitälchen
+Emacs/Emacs_Center_Line.label=Emacs Zeile zentrieren
+Emacs/Emacs_Ctrl-K.label=Emacs Ctrl-K
+Emacs/Emacs_Downcase_Word.label=Emacs Wort zu Kleinbuchstaben
+Emacs/Emacs_Exchange_Point_and_Mark.label=Emacs Punkt und Marke tauschen
+Emacs/Emacs_Fixup_Whitespace.label=Emacs Leerraum korrigieren
+Emacs/Emacs_Forward_Sentence.label=Emacs Satz vorwärts
+Emacs/Emacs_Insert_File.label=Emacs Datei einfügen
+Emacs/Emacs_Kill_Line.label=Emacs Zeile entfernen
+Emacs/Emacs_Kill_Region.label=Emacs Region entfernen
+Emacs/Emacs_Kill_Ring_Save.label=Emacs "Kill Ring" sichern
+Emacs/Emacs_Kill_Sentence.label=Emacs Satz entfernen
+Emacs/Emacs_Next_Line.label=Emacs Nächste Zeile
+Emacs/Emacs_Open_Line.label=Emacs Neue Zeile
+Emacs/Emacs_Previous_Line.label=Emacs Vorige Zeile
+Emacs/Emacs_Set_Mark.label=Emacs Marke setzen
+Emacs/Emacs_Set_Wrap=Emacs Umbruch setzen
+Emacs/Emacs_Transpose_Chars.label=Emacs Zeichen vertauschen
+Emacs/Emacs_Transpose_Lines.label=Emacs Zeilen vertauschen
+Emacs/Emacs_Upcase_Word.label=Emacs Wort zu Großbuchstaben
+#}}}
+
 #{{{ Files
+macros.folder.Files.label=Dateien
+
 Files/Browse_Buffer_Directory.label=Dateisystem-Browser im Verzeichnis der aktiven Datei
 Files/Browse_Directory.label=Dateisystem-Browser mit Verzeichnisabfrage
 Files/Buffer_Switcher.label=Datei wechseln
@@ -2117,7 +2499,7 @@ Files/Copy_Name_to_Clipboard.label=Kopiere Dateiname
 Files/Copy_Path_to_Clipboard.label=Kopiere Dateipfad
 Files/Delete_Current.label=Lösche aktive Datei
 Files/Duplicate_Buffer.label=Dupliziere aktive Datei
-Files/Glob_Close.label=Schließen per Glob-Maske
+Files/Glob_Close.label=Schließen per Glob-Muster
 Files/Insert_Selection.label=Füge Datei ein (Name in Auswahl)
 Files/Next_Dirty_Buffer.label=Nächste nicht gespeicherte Datei
 Files/Open_Path.label=Öffne Datei (Name eingeben)
@@ -2127,6 +2509,8 @@ Files/Toggle_ReadOnly.label=Schreibschutz umschalten
 #}}}
 
 #{{{ Interface
+macros.folder.Interface.label=Ansicht
+
 Interface/Decrease_Font_Size.label=Schriftgröße verkleinern
 Interface/Increase_Font_Size.label=Schriftgröße vergrößern
 Interface/Open_Context_Menu.label=Kontextmenü öffnen
@@ -2139,6 +2523,8 @@ Interface/Toggle_Top_Docking_Area.label=Toggle oberen Dockbereich
 #}}}
 
 #{{{ Java
+macros.folder.Java.label=Java
+
 Java/Create_Constructor.label=Konstruktor erzeugen
 Java/Get_Class_Name.label=Klassenname bestimmen
 Java/Get_Package_Name.label=Paketname bestimmen
@@ -2148,29 +2534,35 @@ Java/Preview_JavaDoc_Of_Current_Buffer.label=JavaDoc-Vorschau der aktiven Datei
 #}}}
 
 #{{{ Misc
+macros.folder.Misc.label=Verschiedenes
+
+Misc/Buffer_to_HyperSearch_Results.label=Hypersuche-Ergebnisse - Zeilen-Import aus aktiver Datei
 Misc/Debug_BufferSets.label=Debug BufferSets
 Misc/Display_Abbreviations.label=Liste der Abkürzungen
-Misc/Display_Actions.label=Liste der Aktionen
+Misc/Display_Actions.label=Liste der Befehle
 Misc/Display_Character_Code.label=Zeige Zeichenkodes (Zeichen am Cursor)
 Misc/Display_Shortcuts.label=Liste der Tastenkürzel
 Misc/Evaluate_Buffer_in_BeanShell.label=Datei in BeanShell ausführen
 Misc/Hex_Convert.label=Hex-Konvertierungen
 Misc/HyperSearch_Results_to_Buffer.label=Hypersuche-Ergebnisse - Zeilen-Export in neue Datei
-Misc/Buffer_to_HyperSearch_Results.label=Hypersuche-Ergebnisse - Zeilen-Import aus aktiver Datei
 Misc/Make_Bug_Report.label=jEdit-Info für Bug-Report
 Misc/Run_Script.label=Starte als Skript
 Misc/Show_Threads.label=Liste der Threads
 #}}}
 
 #{{{ Properties
+macros.folder.Properties.label=Eigenschaften
+
 Properties/Create_Plugin_Announcement.label=Plugin-Bekanntgabe erzeugen
 Properties/Insert_Buffer_Properties.label=jEdit-Dateieigenschaften einfügen
+Properties/jEdit_Properties.label=Liste der jEdit Eigenschaften
 Properties/Look_and_Feel_Properties.label=Liste der Look and Feel Eigenschaften
 Properties/System_Properties.label=Liste der System Eigenschaften
-Properties/jEdit_Properties.label=Liste der jEdit Eigenschaften
 #}}}
 
 #{{{ Text
+macros.folder.Text.label=Text
+
 Text/Add_Prefix_and_Suffix.label=Präfix und Suffix einfügen
 Text/Color_Picker.label=Farbwert wählen
 Text/Compose_Tag.label=XML-Tag zusammenstellen (Auswahl)
diff --git a/org/jedit/localization/jedit_en.props b/org/jedit/localization/jedit_en.props
index 0191504..100f1b5 100644
--- a/org/jedit/localization/jedit_en.props
+++ b/org/jedit/localization/jedit_en.props
@@ -31,11 +31,13 @@ common.more=More
 common.insert=Insert
 common.add=Add
 common.remove=Remove
+common.removeCurrent=Remove Current
 common.moveUp=Move Up
 common.moveDown=Move Down
 common.clearAll=Clear All
 common.selectAll=Select All
 common.selectNone=Select None
+common.loading=Loading...
 
 lineSep.unix=Unix (\\n)
 lineSep.windows=DOS/Windows (\\r\\n)
@@ -742,7 +744,7 @@ badurl.message=The following URL is invalid: {0}\n\
 
 #{{{ Go to line dialog
 goto-line.title=Go To Line
-goto-line.message=Go to line:
+goto-line.message=Go to line ({0} - {1}):
 #}}}
 
 #{{{ Word count dialog
@@ -842,7 +844,8 @@ search.beanshell-replace-btn=Return value of a BeanShell snippet
 search.settings=Settings:
 search.keep=Keep dialog
 search.keep.mnemonic=k
-search.word=Whole word
+search.word=Whole word (q)
+search.word.bar=Whole word
 search.word.mnemonic=q
 search.case=Ignore case
 search.case.mnemonic=i
@@ -888,6 +891,7 @@ search.synchronize.tooltip=Sets filter and directory to current buffer's extensi
 search.findBtn=Find
 search.findBtn.mnemonic=f
 search.replaceBtn=Replace
+search.replaceBtn.mnemonic=p
 search.replaceAndFindBtn=Replace & Find
 search.replaceAndFindBtn.mnemonic=r
 search.replaceAllBtn=Replace All
@@ -1204,7 +1208,7 @@ view.title.select=Please enter a title for this view:
 buffer-options.title=Buffer Options
 buffer-options.caption=This dialog box changes settings for the current buffer\n\
 	only. To change the default settings for an edit mode, see\n\
-	the Utilities->Global Options->Editing dialog.
+	the Global Options->Editing pane.
 buffer-options.loading-saving=Loading and Saving
 buffer-options.lineSeparator=Line separator:
 buffer-options.encoding=Character encoding:
@@ -1236,11 +1240,10 @@ options.general.checkModStatus.prompt=prompt
 options.general.checkModStatus.reload=automatically reload and notify user
 options.general.checkModStatus.silentReload=autoreload without notification
 options.general.checkModStatusUpon=Check for file change upon:
-options.general.checkModStatusUpon.focus=application focus
-options.general.checkModStatusUpon.all=application focus, visiting the buffer or saving any buffer
-options.general.checkModStatusUpon.operations=visiting the buffer or saving any buffer
-options.general.checkModStatusUpon.focusBuffer=visiting or saving the buffer
-options.general.checkModStatusUpon.none=saving the buffer
+options.general.checkModStatusUpon.focus=view focus (check all buffers)
+options.general.checkModStatusUpon.all=view focus or visiting the buffer
+options.general.checkModStatusUpon.visitBuffer=visiting the buffer
+options.general.checkModStatusUpon.none=none
 options.general.recentFiles=Recent files to remember:
 options.general.hypersearch.maxWarningResults=Max Hypersearch Results:
 options.general.sortRecent=Sort recent file list
@@ -1292,7 +1295,7 @@ options.appearance.decorateFrames=Draw window borders using Swing look & feel
 options.appearance.decorateDialogs=Draw dialog box borders using Swing look & feel
 
 options.appearance.localization.section.label=Localization
-options.appearance.usedefaultlocale.label=Use defaut locale
+options.appearance.usedefaultlocale.label=Use default locale
 options.appearance.lang.label=Language (change is effective on restart)
 #}}}
 
@@ -1352,7 +1355,7 @@ options.editing.noWordSep=Extra word characters:
 options.editing.camelCasedWords=Separate "CamelCased" words
 options.editing.noTabs=Soft (emulated with spaces) tabs
 options.editing.elasticTabstops=Indent using elastic tabstops
-options.editing.elasticTabstops.tooltip=(Experimental) - may cause instability in jEdit.
+options.editing.elasticTabstops.tooltip=Columns in lines above and below a "cell" are kept aligned on tab stops that can grow or shrink depending on the width of the cell.
 options.editing.deepIndent=Deep indent
 options.editing.autoIndent=Automatic indentation
 options.editing.largefilemode.title=Large file mode
@@ -1374,10 +1377,8 @@ options.encodings.label=Encodings
 options.encodings.selectEncodings=Select the encodings that should be shown in encoding dialogs:
 options.encodings.available=Available encoding(s)
 options.encodings.selected=Selected encoding(s)
-options.encodings.available.tooltip=<html>Encodings in this column will <b>not</b> be listed in encoding dialogs.\
-  Drag them to the right column to activate them</html>
-options.encodings.selected.tooltip=Encodings in this column be shown in encoding dialogs.\
-  Drag them to the left column to hide them
+options.encodings.available.tooltip=<html>Encodings in this column will <b>not</b> be shown as choices in encoding comboboxes. Drag them to the right column to show them. </html>
+options.encodings.selected.tooltip=<html>Encodings in this column will be shown as choices in encoding comboboxes of jEdit's GUI. Drag them to the left column to hide them.</html>
 #}}}
 
 #{{{ Gutter pane
@@ -1414,6 +1415,7 @@ options.mouse.dragAndDrop=Drag and drop in text area
 options.mouse.joinNonWordChars=Double-click drag joins non-alphanumeric characters
 options.mouse.middleMousePaste=Quick copy using middle mouse button
 options.mouse.ctrlForRectangularSelection=Switch to rectangular selection while Ctrl is pressed
+options.mouse.singleClickToOpen=Single-click to open files and folders
 options.mouse.gutter.foldClick=Click in gutter:
 options.mouse.gutter.SfoldClick=Shift-click in gutter:
 options.mouse.gutter.toggle-fold=Collapse/expand fold
@@ -1432,6 +1434,10 @@ options.plugin-manager.location=Install plugins in:
 options.plugin-manager.settings-dir=jEdit settings directory
 options.plugin-manager.app-dir=jEdit application directory
 options.plugin-manager.none=Plugin Central default
+options.plugin-manager.disable-obsolete=Disable obsolete plugins
+options.plugin-manager.list-cache.minutes=Cache plugin list for: (minutes)
+options.plugin-manager.no-plugin-available=No plugin available
+options.plugin-manager.no-plugin-uptodate=All plugins are up to date
 #}}}
 
 #{{{ Printing pane
@@ -1500,6 +1506,7 @@ options.shortcuts.label=Shortcuts
 options.shortcuts.select.label=Edit Shortcuts:
 options.shortcuts.select.tooltip=You can select globals, macros, or plugin shortcuts
 options.shortcuts.name=Command
+options.shortcuts.actionset=Action set
 options.shortcuts.shortcut1=Primary shortcut
 options.shortcuts.shortcut2=Alternative shortcut
 options.shortcuts.filter.label=Filter:
@@ -1596,8 +1603,7 @@ options.textarea.electricBorders=Electric (auto scroll) borders
 options.textarea.stdNextPrevWord=Go to next/previous word commands eat whitespace
 options.textarea.antiAlias=Anti Aliased smooth text
 options.textarea.antiAlias.tooltip=Slows down display on some systems
-options.textarea.fracFontMetrics=Fractional font metrics (for better smooth \
-	text display)
+options.textarea.fracFontMetrics=Fractional font metrics
 options.textarea.fracFontMetrics.tooltip=Not recommended with subpixel antialiasing
 options.textarea.stripTrailingEOL=Hide final end of line (if any)
 options.textarea.completeFromAllBuffers=Complete words from all open buffers (default is \
@@ -1634,6 +1640,7 @@ options.view.viewLayout=View layout
 options.view.floatableToolbars=Floatable Toolbars
 options.view.alternateDockingLayout=Alternate docked window placement
 options.view.alternateToolBarLayout=Alternate tool bar placement
+options.view.abbreviatePaths=Abbreviate paths with environment variables when possible
 options.view.showFullPath=Show full path of buffer in title bar
 options.view.showSearchbar=Always show search bar
 options.view.beepOnSearchAutoWrap=Beep when searching automatically wraps
@@ -1645,10 +1652,6 @@ options.view.fullScreenIncludesMenu=Show the menu bar in full-screen mode
 options.view.fullScreenIncludesToolbar=Show the toolbars in full-screen mode
 options.view.fullScreenIncludesStatus=Show the status bar in full-screen mode
 options.bufferset.scope=BufferSet scope:
-options.editpane.bufferset.contain=New BufferSets contain:
-options.editpane.bufferset.newbufferset.copy=copy of current BufferSet
-options.editpane.bufferset.newbufferset.empty=an empty buffer
-options.editpane.bufferset.newbufferset.currentbuffer=current buffer only
 #}}}
 
 
@@ -1845,7 +1848,7 @@ vfs.browser.next.label=Next Directory
 #}}}
 
 #{{{ Commands menu
-vfs.browser.commands.label=Commands
+vfs.browser.commands.label=$Commands
 vfs.browser.commands.encoding.label=Encoding
 vfs.browser.commands.encoding.auto-detect=Auto-detect
 
@@ -1856,14 +1859,14 @@ vfs.browser.open-split.label=New Split
 #}}}
 
 #{{{ Plugins menu
-vfs.browser.plugins.label=Plugins
+vfs.browser.plugins.label=$Plugins
 vfs.browser.plugins.plugin-manager.label=Plugin Manager...
 vfs.browser.plugins.plugin-options.label=Plugin Options...
 vfs.browser.plugins.no-plugins.label=No Plugins
 #}}}
 
 #{{{ Favorites menu
-vfs.browser.favorites.label=Favorites
+vfs.browser.favorites.label=Fa$vorites
 vfs.browser.favorites.add-to-favorites.label=Add to Favorites
 vfs.browser.favorites.edit-favorites.label=Edit Favorites
 vfs.browser.favorites.no-favorites.label=No Favorites
@@ -1883,13 +1886,11 @@ vfs.browser.recurse-favorites.title=Cannot Add Favorites to Itself
 vfs.browser.recurse-favorites.message=The favorites list cannot be added to itself.
 
 vfs.browser.delete-confirm.title=Delete File Confirmation
-vfs.browser.delete-confirm.message=Are you sure you want to delete the following {1}?\n\n\
-	{0}
+vfs.browser.delete-confirm.message=Are you sure you want to delete the following {1}?
 
 vfs.browser.delete-favorites.title=Delete From Favorites
 vfs.browser.delete-favorites.message=Are you sure you want to remove the following files \
-	from the favorites?\n\n\
-	{0}
+	from the favorites?
 
 vfs.browser.rename.title=Rename File
 vfs.browser.rename.message=Enter a new name for {0}:
@@ -1953,6 +1954,7 @@ install-plugins.depend.message=One or more of the plugins you are installing\n\
 	installed if you continue.
 
 plugin-manager.status.loaded=Loaded
+plugin-manager.status.disabled=Unsupported
 plugin-manager.status.not-loaded=Not loaded
 plugin-manager.status.error=Error
 
@@ -2046,6 +2048,9 @@ log-viewer.message.message.label=Message
 log-viewer.message.notice.label=Notice
 log-viewer.message.warning.label=Warning
 log-viewer.message.error.label=Error
+# This one should be actually placed in Debugging options, but
+# we don't have such a pane yet
+debug.beepOnOutput.label=Beep on output
 #}}}
 
 logs-remove-all-errors.label=Remove all errors
@@ -2173,7 +2178,7 @@ macro.rs.DeleteCurrent.Deleted.message=Deleted:
 #}}}
 
 #{{{ Glob Close
-macro.rs.GlobClose.GlobPattern.label=Glob Pattern:
+macro.rs.GlobClose.GlobPattern.label=Glob Pattern (e.g. *.txt or /usr/include/*):
 macro.rs.GlobClose.ErrorGlobPattern.error=Error in glob pattern:
 #}}}
 
@@ -2418,9 +2423,6 @@ macros.folder.Editing.label=Editing
 
 Editing/Duplicate_Lines_Above.label=Duplicate Lines Above
 Editing/Duplicate_Lines_Below.label=Duplicate Lines Below
-Editing/Emacs_Ctrl-K.label=Emacs Ctrl-K
-Editing/Emacs_Next_Line.label=Emacs Next Line
-Editing/Emacs_Previous_Line.label=Emacs Previous Line
 Editing/Go_to_Column.label=Go To Column
 Editing/Greedy_Backspace.label=Greedy Backspace
 Editing/Greedy_Delete.label=Greedy Delete
@@ -2435,6 +2437,32 @@ Editing/Open_Line_Below.label=Open Line Below
 Editing/Toggle_Fold.label=Toggle Fold
 #}}}
 
+#{{{ Emacs
+macros.folder.Emacs.label=Emacs
+Emacs/Emacs_Align_Decls.label=Emacs Align Decls
+Emacs/Emacs_Backward_Sentence.label=Emacs Backward Sentence
+Emacs/Emacs_Capitalize_Word.label=Emacs Capitalize Word
+Emacs/Emacs_Center_Line.label=Emacs Center Line
+Emacs/Emacs_Ctrl-K.label=Emacs Ctrl-K
+Emacs/Emacs_Downcase_Word.label=Emacs Downcase Word
+Emacs/Emacs_Exchange_Point_and_Mark.label=Emacs Exchange Point and Mark
+Emacs/Emacs_Fixup_Whitespace.label=Emacs Fixup Whitespace
+Emacs/Emacs_Forward_Sentence.label=Emacs Forward Sentence
+Emacs/Emacs_Insert_File.label=Emacs Insert File
+Emacs/Emacs_Kill_Line.label=Emacs Kill Line
+Emacs/Emacs_Kill_Region.label=Emacs Kill Region
+Emacs/Emacs_Kill_Ring_Save.label=Emacs Kill Ring Save
+Emacs/Emacs_Kill_Sentence.label=Emacs Kill Sentence
+Emacs/Emacs_Next_Line.label=Emacs Next Line
+Emacs/Emacs_Open_Line.label=Emacs Open Line
+Emacs/Emacs_Previous_Line.label=Emacs Previous Line
+Emacs/Emacs_Set_Mark.label=Emacs Set Mark
+Emacs/Emacs_Set_Wrap=Emacs Set Wrap
+Emacs/Emacs_Transpose_Chars.label=Emacs Transpose Chars
+Emacs/Emacs_Transpose_Lines.label=Emacs Transpose Lines
+Emacs/Emacs_Upcase_Word.label=Emacs Upcase Word
+#}}}
+
 #{{{ Files
 macros.folder.Files.label=Files
 
diff --git a/org/jedit/localization/jedit_fr.props b/org/jedit/localization/jedit_fr.props
index 3e2e2ee..84a7b44 100644
--- a/org/jedit/localization/jedit_fr.props
+++ b/org/jedit/localization/jedit_fr.props
@@ -31,11 +31,13 @@ common.more=Plus
 common.insert=Insérer
 common.add=Ajouter
 common.remove=Supprimer
+common.removeCurrent=Supprimer
 common.moveUp=Monter
 common.moveDown=Descendre
 common.clearAll=Tout effacer
 common.selectAll=Tout sélectionner
 common.selectNone=Ne rien sélectionner
+common.loading=Chargement...
 
 lineSep.unix=Unix (\\n)
 lineSep.windows=DOS/Windows (\\r\\n)
@@ -96,7 +98,7 @@ global-close-buffer.label=Fermer (général)
 global-close-buffer.tooltip=Fermer le tampon dans tous les panneaux d'édition et fenêtres
 closeall-except-active.tooltip=Effacer le jeu de tampons dans le panneau d'édition courant à l'exception du(des) tampon(s) affichés
 closeall-except-active.label=Fermer les au$tres
-closeall-bufferset.label=Tou&t fermer
+closeall-bufferset.label=Tou$t fermer
 closeall-bufferset.tooltip=Fermer le jeu de tampons dans le panneau d'édition
 bufferset-toggle-exclusive.label=Basculer vers les jeux de tampons exclusifs
 bufferset-toggle-exclusive.tooltip=Lorsqu'un tampon est ouvert, le fermer dans d'autres jeux de tampons non inclus.
@@ -371,7 +373,7 @@ io-progress-monitor.label=Progression $I/O
 task-monitor.label=Gestionnaire des $tâches
 keyboard-tester.label=$Tester un raccourci clavier...
 memory-status.label=Utilisation de la $mémoire...
-reload-modes.label=$Recharger l'éditeur de modes
+reload-modes.label=$Recharger les modes de coloration syntaxique
 #}}}
 
 #{{{ Quick options menu
@@ -612,16 +614,16 @@ largeBufferDialog.title=Tampon volumineux {0}
 largeBufferDialog.message=Le tampon est très volumineux et jEdit risque de ne plus répondre\n\
 	à cause de la coloration syntaxique. Vous devriez prendre en considération les options suivantes.\n\
 	-Conserver la coloration complète : la coloration syntaxique fonctionnera comme habituellement\n\
-	jEdit ralentira probablement, ceci n''est pas recommandé.\n\
+	jEdit ralentira probablement, ceci n'est pas recommandé.\n\
 	-Coloration syntaxique hors contexte. Dans ce cas, jEdit procédera\n\
 	à une coloration rapide, mais le résultat ne sera pas parfait. Le\n\
 	tampon est coloré ligne par ligne sans vérification du contexte\n\
 	de la ligne précédente. Il est possible que la coloration ne soit pas précise\n\
 	si vous avez des portions de code sur plusieurs lignes (commentaires, balises xml...)\n\
-	-Utilisez le mode d''édition brut de jEdit (pas de coloration syntaxique)
+	-Utilisez le mode d'édition brut de jEdit (pas de coloration syntaxique)
 largeBufferDialog.fullSyntax=Coloration syntaxique complète
 largeBufferDialog.contextInsensitive=Coloration syntaxique hors contexte
-largeBufferDialog.defaultMode=Mode d''édition brut
+largeBufferDialog.defaultMode=Mode d'édition brut
 #}}}
 
 #{{{ I/O error dialog box
@@ -635,7 +637,7 @@ ioerror.directory-error-nomsg=Impossible de lister les fichiers de dossier.
 ioerror.encoding-error=Chargement correct du fichier impossible (des données ont pu être perdues) en utilisant\n\
 	un encodage « {0} ».\n\
 	({1})\n\
-	Esssayez de choisir un encodage différent.\n\
+	Essayez de choisir un encodage différent.\n\
 	Pour ce faire allez dans Fichier->Recharger avec encodage.\n\
 	Si vous souhaitez que cela se fasse automatiquement, ajoutez les éléments\n\
 	dans la "Liste des encodages ajoutés" dans le panneau encodage des options générales.
@@ -739,7 +741,7 @@ badurl.message=Cette URL est invalide : {0}\n
 
 #{{{ Go to line dialog
 goto-line.title=Atteindre une ligne
-goto-line.message=Atteindre la ligne :
+goto-line.message=Atteindre la ligne ({0} - {1}) :
 #}}}
 
 #{{{ Word count dialog
@@ -840,6 +842,7 @@ search.settings=Paramètres :
 search.keep=Laisser la boîte ouverte
 search.keep.mnemonic=o
 search.word=Mot entier
+search.word.bar=Mot entier
 search.word.mnemonic=e
 search.case=Ignorer la casse
 search.case.mnemonic=i
@@ -885,6 +888,7 @@ search.synchronize.tooltip=Défini filtre d'extension et dossier pour la localis
 search.findBtn=Rechercher
 search.findBtn.mnemonic=h
 search.replaceBtn=Remplacer
+search.replaceBtn.mnemonic=e
 search.replaceAndFindBtn=Remplacer & rechercher
 search.replaceAndFindBtn.mnemonic=r
 search.replaceAllBtn=Tout remplacer
@@ -1430,6 +1434,8 @@ options.plugin-manager.location=Installer les plugins dans :
 options.plugin-manager.settings-dir=Le dossier de paramètres utilisateur
 options.plugin-manager.app-dir=Le dossier d'installation de jEdit
 options.plugin-manager.none=Centrale de plugins par défaut
+options.plugin-manager.no-plugin-available=Aucun plugin disponible
+options.plugin-manager.no-plugin-uptodate=Tous les plugins sont à jour
 #}}}
 
 #{{{ Printing pane
@@ -1594,8 +1600,7 @@ options.textarea.electricBorders=Bordures électriques (défilement automatique)
 options.textarea.stdNextPrevWord=La commande « Atteindre le mot suivant/précédent » ignore les espaces
 options.textarea.antiAlias=Lissage du texte
 options.textarea.antiAlias.tooltip=Ralentit l'affichage sur certains systèmes
-options.textarea.fracFontMetrics=Police à espacement proportionnel (pour un affichage plus « doux » \
-	du texte)
+options.textarea.fracFontMetrics=Police à espacement proportionnel
 options.textarea.fracFontMetrics.tooltip=Non recommandé avec l'antialiasing de sous-pixel
 options.textarea.stripTrailingEOL=Masquer la fin de ligne (si existante)
 options.textarea.completeFromAllBuffers=Mots complets de tous les tampons ouverts (par défaut, \
@@ -1814,7 +1819,7 @@ vfs.browser.file_filter.dir_only=Uniquement les dossiers
 vfs.browser.browse-window.label=Explorer dans une nouvelle fenêtre
 vfs.browser.browse.label=Explorer
 vfs.browser.close.label=Fermer
-vfs.browser.copy-path.label=Copier le chemin
+vfs.browser.copy-path.label=Copier
 vfs.browser.delete.label=Supprimer...
 vfs.browser.home.label=Dossier utilisateur
 vfs.browser.properties.label=Propriétés
@@ -1878,16 +1883,14 @@ vfs.browser.bad-filter.title=Filtre invalide
 vfs.browser.bad-filter.message=Le filtre {0} est invalide ({1})
 
 vfs.browser.recurse-favorites.title=Impossible d'ajouter des favoris à eux-mêmes
-vfs.browser.recurse-favorites.message=La liste des favoris ne peut étre ajoutée à elle-même.
+vfs.browser.recurse-favorites.message=La liste des favoris ne peut être ajoutée à elle-même.
 
 vfs.browser.delete-confirm.title=Confirmation de suppression de fichiers
-vfs.browser.delete-confirm.message=Souhaitez-vous vraiment supprimer les fichiers suivants {1}?\n\n\
-	{0}
+vfs.browser.delete-confirm.message=Souhaitez-vous vraiment supprimer les fichiers suivants?
 
 vfs.browser.delete-favorites.title=Retirer des favoris
 vfs.browser.delete-favorites.message=Souhaitez-vous vraiment supprimer les dossiers/fichiers suivants \
-	de la liste des favoris ?\n\n\
-	{0}
+	de la liste des favoris ?
 
 vfs.browser.rename.title=Renommer le fichier
 vfs.browser.rename.message=Indiquez le nouveau nom pour {0} :
@@ -2167,7 +2170,7 @@ macro.rs.DeleteCurrent.Deleted.message=Supprimé(s) :
 #}}}
 
 #{{{ Glob Close
-macro.rs.GlobClose.GlobPattern.label=Motif :
+macro.rs.GlobClose.GlobPattern.label=Motif (par exemple *.txt ou /usr/include/*):
 macro.rs.GlobClose.ErrorGlobPattern.error=Erreur dans le motif :
 #}}}
 
@@ -2239,7 +2242,6 @@ macro.rs.DebugBuffersets.EndEditpaneList.label=END EDITPANE LIST
 #{{{ Display Abbreviations
 macro.rs.DisplayAbbreviations.Abbreviation.label=Abréviation
 macro.rs.DisplayAbbreviations.Expansion.label=Expansion
-macro.rs.DisplayAbbreviations.AbbreviationSet.label=Jeu d'abréviations :
 macro.rs.DisplayAbbreviations.Close.label=Fermer
 macro.rs.DisplayAbbreviations.WriteSet.label=Afficher le jeu
 macro.rs.DisplayAbbreviations.WriteAll.label=Tout afficher
diff --git a/org/jedit/localization/jedit_ja.props b/org/jedit/localization/jedit_ja.props
index 4016428..85c8b8d 100644
--- a/org/jedit/localization/jedit_ja.props
+++ b/org/jedit/localization/jedit_ja.props
@@ -31,6 +31,7 @@ common.more=さらに
 common.insert=挿入
 common.add=追加
 common.remove=削除
+common.removeCurrent=現在のものを削除
 common.moveUp=上へ
 common.moveDown=下へ
 common.clearAll=すべてクリア
@@ -70,7 +71,7 @@ view.action.close-tooltip=アクションバーを隠す (ESC)
 #}}}
 
 #{{{ Context menu
-view.context.customize=メニューをカスタマイズ...
+view.context.customize=このメニューをカスタマイズ...
 #}}}
 
 #{{{ System tray menu
@@ -99,7 +100,7 @@ closeall-except-active.label=他を閉じる($T)
 closeall-bufferset.label=すべて閉じる($E)
 closeall-bufferset.tooltip=編集ペインのバッファセットをクリアします。
 bufferset-toggle-exclusive.label=排他バッファセットの切り替え($X)
-bufferset-toggle-exclusive.tooltip=バッファが開かれるとき、他の無関係なバッファセット中にあれば閉じます。
+bufferset-toggle-exclusive.tooltip=バッファを表示したとき、他の無関係なバッファセット中に含まれている方を閉じます。
 close-all.label=すべて閉じる(グローバル)
 close-all.tooltip=すべてのビューのすべてのバッファを閉じます。
 save.label=保存($S)
@@ -655,6 +656,9 @@ ioerror.delete-error=ファイルを削除できません。
 ioerror.rename-exists=既存ファイル {0} を上書きできません。
 ioerror.rename-error={0} に名前を変更できません。
 ioerror.mkdir-error=ディレクトリを作成できません。
+ioerror.backup-failed=バックアップに失敗。 "保存とバックアップ" の設定を確認してください。
+ioerror.backup-same-name=バックアップファイル名が元のファイル名と同じです。
+ioerror.copy-self=ファイルを自身にコピーするのは破壊的操作のため、拒否されました: {0}
 
 vfs.not-supported.list=ファイルシステム "{0}" 上のディレクトリはブラウズできません。
 vfs.not-supported.load=ファイルシステム "{0}" 上のファイルを開くことはできません。
@@ -739,7 +743,7 @@ badurl.message=この URL は無効です: {0}\n\
 
 #{{{ Go to line dialog
 goto-line.title=行移動
-goto-line.message=移動先の行:
+goto-line.message=移動先の行 ({0} - {1}):
 #}}}
 
 #{{{ Word count dialog
@@ -840,6 +844,7 @@ search.settings=オプション:
 search.keep=ダイアログを維持(K)
 search.keep.mnemonic=K
 search.word=完全一致単語のみ(Q)
+search.word.bar=完全一致単語のみ
 search.word.mnemonic=Q
 search.case=大文字小文字を区別しない(I)
 search.case.mnemonic=I
@@ -897,7 +902,7 @@ search.replaceAllBtn.mnemonic=A
 #{{{ Keep searching dialog
 keepsearching.title=これ以上の一致は発見できません
 keepsearching.message=これ以上の一致は発見できません。\n\
-	{0,choice,0#先頭|1#末尾}から検索を続けますか?
+	{0,choice,0\#先頭|1\#末尾}から検索を続けますか?
 #}}}
 
 #{{{ HyperSearch results dialog
@@ -1233,10 +1238,9 @@ options.general.checkModStatus.prompt=問い合わせる
 options.general.checkModStatus.reload=自動的に更新し通知する
 options.general.checkModStatus.silentReload=通知せずに自動更新
 options.general.checkModStatusUpon=ファイル変更を確認するきっかけ:
-options.general.checkModStatusUpon.focus=アプリケーションフォーカス
-options.general.checkModStatusUpon.all=アプリケーションフォーカス 対象バッファ表示 他バッファの保存
-options.general.checkModStatusUpon.operations=対象バッファ表示 他バッファの保存
-options.general.checkModStatusUpon.focusBuffer=対象バッファ表示および保存
+options.general.checkModStatusUpon.focus=ビューへのフォーカス (すべてのバッファを確認)
+options.general.checkModStatusUpon.all=ビューへのフォーカス 対象バッファ表示
+options.general.checkModStatusUpon.visitBuffer=対象バッファ表示
 options.general.checkModStatusUpon.none=対象バッファの保存
 options.general.recentFiles=最近開いたファイルの記憶:
 options.general.hypersearch.maxWarningResults=ハイパーサーチの中止を問う閾値:
@@ -1305,7 +1309,7 @@ options.context.add.title=コンテキストメニューに追加
 options.context.add.caption=コンテキストメニューに追加:
 options.context.add.separator=セパレータ
 options.context.add.action=コマンド/マクロ:
-options.context.includeOptionsLink.label="このメニューをカスタマイズ..."を含むリンク
+options.context.includeOptionsLink.label="このメニューをカスタマイズ..." へのリンクを含む
 
 options.context.reset.dialog.title=デフォルトに戻す
 options.context.reset.dialog.message=本当にコンテキストメニューをインストールデフォルトに戻しますか?
@@ -1429,6 +1433,8 @@ options.plugin-manager.location=プラグインのインストール先:
 options.plugin-manager.settings-dir=jEdit 個人設定ディレクトリ
 options.plugin-manager.app-dir=jEdit アプリケーションディレクトリ
 options.plugin-manager.none=デフォルトのプラグインセンター
+options.plugin-manager.disable-obsolete=廃止されたプラグインを無効化
+options.plugin-manager.list-cache.minutes=プラグインリストのキャッシュ時間: (分)
 #}}}
 
 #{{{ Printing pane
@@ -1504,18 +1510,18 @@ options.shortcuts.filter.tooltip=名称がこの文字列を含むアクショ
 options.shortcuts.clear.label=クリア
 
 grab-key.title=ショートカットを指定してください
-grab-key.caption="{0}"に割当てたいショートカットキーを押し、了解をクリックしてください。
+grab-key.caption="{0}"に割当てたいショートカットキーを押し、OKをクリックしてください。
 grab-key.keyboard-test=問題を起こしているキーストロークを入力してください。
 grab-key.assigned-to=現在の割当: {0}
 grab-key.assigned-to.none=<なし>
 grab-key.assigned-to.prefix={0} プレフィクス
 grab-key.clear=クリア
-grab-key.remove=割当の解除
+grab-key.remove=現在のものを削除
 
-grab-key.remove-ask.title=ショートカットを解除しますか?
+grab-key.remove-ask.title=ショートカットを削除しますか?
 grab-key.remove-ask.message=\
 	新たなショートカットが指定されませんでした。\n\
-	現在のショートカットを解除しますか?
+	現在のショートカットを削除しますか?
 
 grab-key.duplicate-alt-shortcut.title=重複ショートカット
 grab-key.duplicate-alt-shortcut.message=\
@@ -1593,8 +1599,7 @@ options.textarea.electricBorders=自動スクロール
 options.textarea.stdNextPrevWord=次/前の単語へ移動するときホワイトスペースを含む
 options.textarea.antiAlias=アンチエイリアス スムーズフォント
 options.textarea.antiAlias.tooltip=いくつかのシステムで表示が遅くなります
-options.textarea.fracFontMetrics=Fractional フォントメトリクス (文字の表示が\
-	よりスムーズになります)
+options.textarea.fracFontMetrics=Fractional フォントメトリクス
 options.textarea.fracFontMetrics.tooltip=サブピクセルアンチエイリアスとの併用はお薦めしません
 options.textarea.stripTrailingEOL=最終行末を隠す (あれば)
 options.textarea.completeFromAllBuffers=開いているすべてのバッファから単語補完 (デフォルト\
@@ -1642,10 +1647,6 @@ options.view.fullScreenIncludesMenu=フルスクリーンモードでメニュ
 options.view.fullScreenIncludesToolbar=フルスクリーンモードでツールバーを表示
 options.view.fullScreenIncludesStatus=フルスクリーンモードでステータスバーを表示
 options.bufferset.scope=バッファセットのスコープ:
-options.editpane.bufferset.contain=新規バッファセットの内容:
-options.editpane.bufferset.newbufferset.copy=現在のバッファセットのコピー
-options.editpane.bufferset.newbufferset.empty=空のバッファひとつ
-options.editpane.bufferset.newbufferset.currentbuffer=現在のバッファのみ
 #}}}
 
 
@@ -1842,7 +1843,7 @@ vfs.browser.next.label=次のディレクトリ
 #}}}
 
 #{{{ Commands menu
-vfs.browser.commands.label=コマンド
+vfs.browser.commands.label=コマンド($C)
 vfs.browser.commands.encoding.label=エンコーディング
 vfs.browser.commands.encoding.auto-detect=自動検出
 
@@ -1880,12 +1881,10 @@ vfs.browser.recurse-favorites.title=自己循環するお気に入りの禁止
 vfs.browser.recurse-favorites.message=お気に入りリストをそれ自身に追加することはできません。
 
 vfs.browser.delete-confirm.title=ファイル削除の確認
-vfs.browser.delete-confirm.message=以下の{1}を本当に削除しますか?\n\n\
-	{0}
+vfs.browser.delete-confirm.message=以下の{1}を本当に削除しますか?
 
 vfs.browser.delete-favorites.title=お気に入りからの削除
-vfs.browser.delete-favorites.message=以下のファイルを本当にお気に入りから削除しますか?\n\n\
-	{0}
+vfs.browser.delete-favorites.message=以下のファイルを本当にお気に入りから削除しますか?
 
 
 vfs.browser.rename.title=ファイル名の変更
@@ -1950,6 +1949,7 @@ install-plugins.depend.message=インストールしようとしているプラ
 	インストールされます。
 
 plugin-manager.status.loaded=ロードされています
+plugin-manager.status.disabled=サポートされていません
 plugin-manager.status.not-loaded=ロードされていません
 plugin-manager.status.error=エラー
 
@@ -2028,8 +2028,8 @@ fileprop.properties=プロパティ
 fileprop.readable=読込み可能
 fileprop.writeable=書込み可能
 fileprop.attribute=属性
-fileprop.okBtn=了解
-fileprop.cancelBtn=取消し
+fileprop.okBtn=OK
+fileprop.cancelBtn=キャンセル
 fileprop.selectedFiles=選択されたファイル
 fileprop.selectedDirectories=選択されたディレクトリ
 #}}}
@@ -2043,6 +2043,9 @@ log-viewer.message.message.label=Message
 log-viewer.message.notice.label=Notice
 log-viewer.message.warning.label=Warning
 log-viewer.message.error.label=Error
+# This one should be actually placed in Debugging options, but
+# we don't have such a pane yet
+debug.beepOnOutput.label=Beep on output
 #}}}
 
 logs-remove-all-errors.label=すべてのエラーを削除
diff --git a/org/jedit/localization/jedit_ru.props b/org/jedit/localization/jedit_ru.props
index 8b74e51..81d5c6b 100644
--- a/org/jedit/localization/jedit_ru.props
+++ b/org/jedit/localization/jedit_ru.props
@@ -737,7 +737,7 @@ badurl.message=URL нокорректен: {0}\n\
 
 #{{{ Go to line dialog
 goto-line.title=Перейти к строке
-goto-line.message=Перейти к строке:
+goto-line.message=Перейти к строке ({0} - {1}):
 #}}}
 
 #{{{ Word count dialog
@@ -883,6 +883,7 @@ search.synchronize.tooltip=Установить фильтр и дирекори
 search.findBtn=Искать
 search.findBtn.mnemonic=f
 search.replaceBtn=Заменить
+search.replaceBtn.mnemonic=
 search.replaceAndFindBtn=Заменить и найти
 search.replaceAndFindBtn.mnemonic=r
 search.replaceAllBtn=Заменить все
@@ -1591,8 +1592,7 @@ options.textarea.electricBorders=Электрические бордюры (ав
 options.textarea.stdNextPrevWord=Переход к следующему/предыдущему слову включает пробелы
 options.textarea.antiAlias=Сглаживание шрифта
 options.textarea.antiAlias.tooltip=Может замедлять дисплей на некоторых системах
-options.textarea.fracFontMetrics=Дробная размерность шрифта (для лучшего \
-	сглаживания текста)
+options.textarea.fracFontMetrics=Дробная размерность шрифта
 options.textarea.fracFontMetrics.tooltip=Не рекомендуется с суб-пиксельным сглаживанием
 options.textarea.stripTrailingEOL=Прятать последнюю пустую строку (когда она есть)
 options.textarea.completeFromAllBuffers=Оканчивать слова из всех буферов (изначально \
@@ -1640,10 +1640,6 @@ options.view.fullScreenIncludesMenu=Показывать панель меню 
 options.view.fullScreenIncludesToolbar=Показывать панель инструментов в полно-экранном режиме
 options.view.fullScreenIncludesStatus=Показывать панел статуся в полно-экранном режиме
 options.bufferset.scope=Охват набора буферов:
-options.editpane.bufferset.contain=Новый набор содержит:
-options.editpane.bufferset.newbufferset.copy=копию текущего набора
-options.editpane.bufferset.newbufferset.empty=пустой буфер
-options.editpane.bufferset.newbufferset.currentbuffer=только текущий буфер
 #}}}
 
 
diff --git a/org/jedit/localization/jedit_zh.props b/org/jedit/localization/jedit_zh.props
new file mode 100644
index 0000000..a5f0ea4
--- /dev/null
+++ b/org/jedit/localization/jedit_zh.props
@@ -0,0 +1,2536 @@
+###
+### jEdit user interface definitions,
+### :tabSize=8:indentSize=8:noTabs=false:
+### :folding=explicit:collapseFolds=1:
+### :encoding=UTF-8:
+###
+### Copyright (C) 1998, 2005 Slava Pestov
+###
+
+#{{{ jEdit core (jedit_gui.props)
+
+#{{{ Default user catalog file
+defaultCatalog=<?xml version="1.0"?>\n\
+	<!DOCTYPE MODES SYSTEM "catalog.dtd">\n\
+	\n\
+	<MODES>\n\
+	\n\
+	<!-- Add lines like the following, one for each edit mode you add: -->\n\
+	<!-- <MODE NAME="foo" FILE="foo.xml" FILE_NAME_GLOB="*.foo" /> -->\n\
+	\n\
+	</MODES>
+#}}}
+
+#{{{ Common strings
+common.ok=确定
+common.cancel=取消
+common.close=关闭
+common.error=错误
+common.apply=应用
+common.more=更多
+common.insert=插入
+common.add=添加
+common.remove=移除
+common.removeCurrent=移除当前项目
+common.moveUp=向上移动
+common.moveDown=向下移动
+common.clearAll=全部清除
+common.selectAll=全选
+common.selectNone=反选
+
+lineSep.unix=Unix (\\n)
+lineSep.windows=DOS/Windows (\\r\\n)
+lineSep.mac=MacOS (\\r)
+#}}}
+
+#{{{ Miscellaneous
+history.caption=历史输入字符:
+
+action-set.jEdit=内建命令
+action-set.browser=文件系统浏览器
+action-set.macros=宏
+action-set.plugin=插件: {0}
+
+macro-handler.beanshell.label=BeanShell 脚本
+macro-handler.beanshell.glob=*.bsh
+
+save-layout-failed.message=无法保存对接布局.
+load-layout.title=加载对接布局
+load-layout.message=选择对接布局:
+save-layout.title=保存对接布局
+save-layout.message=选择保存的对接布局:
+#}}}
+
+#{{{ Tool bar
+view.search.find=搜索:
+view.search.close-tooltip=隐藏搜索条 (ESCAPE)
+
+view.action.prompt=操作:
+view.action.no-completions=没有匹配的操作
+view.action.close-tooltip=隐藏操作工具条 (ESCAPE)
+#}}}
+
+#{{{ Context menu
+view.context.customize=个性化菜单...
+#}}}
+
+#{{{ System tray menu
+tray.newView.label=新视图
+tray.newPlainView.label=新的空白视图
+tray.exit.label=退出
+#}}}
+
+#{{{ Menu bar
+
+#{{{ File menu
+file.label=$文件
+new-file.label=$新建
+new-file-in-mode.label=新建模式 ($Mode)
+new-file-in-mode.dialog.title=新文件
+new-file-in-mode.dialog.message=编辑模式:
+open-file.label=打开($Open)...
+reload.label=重新加载($Reload)
+reload-all.label=重新加载所有(Reloa$d All)
+close-buffer.label=关闭($Close)
+close-buffer.tooltip=关闭编辑面板
+global-close-buffer.label=关闭 (整个程序)
+global-close-buffer.tooltip=关闭所有视图
+closeall-except-active.tooltip=关闭其他编辑面板
+closeall-except-active.label=关闭其他(Close O$thers)
+closeall-bufferset.label=关闭所有(Clos$e All)
+closeall-bufferset.tooltip=清除编辑面板
+bufferset-toggle-exclusive.label=切换内容(Toggle E$xclusive BufferSets)
+bufferset-toggle-exclusive.tooltip=一个缓存内容被访问时,在其他非交叉区关闭它
+close-all.label=关闭所有
+close-all.tooltip=关闭所有视图中的所有内容
+save.label=保存($Save)
+save-as.label=另存为(S$ave As)...
+save-a-copy-as.label=保存一个副本(Save a Cop$y As)...
+save-a-copy-as.tooltip=不改变当前内容路径
+save-all.label=保存全部(Save A$ll)...
+print.label=打印($Print)...
+page-setup.label=页面配置(Pa$ge Setup)...
+# Print selection not yet implemented
+#print-selection.label=Prin$t Selection...
+exit.label=退出(E$xit)
+
+#{{{ Recent Files menu
+recent-files.label=最近文件(Recent $Files)
+recent-files.textfield.tooltip=在此输入前缀过滤或者全局模式
+no-recent-files.label=没有最近文件
+clear-recent-files.label=清除最近文件
+#}}}
+
+reload-encoding.label=重新加载编码(Reload with $Encoding)
+reload-encoding.error={0} 不是一个有效的编码
+
+#}}}
+
+#{{{ Edit menu
+
+edit.label=编辑($Edit)
+undo.label=撤销($Undo)
+redo.label=重做($Redo)
+cut.label=剪切($Cut)
+copy.label=复制(C$opy)
+paste.label=粘贴($Paste)
+select-all.label=全选(Select $All)
+word-count.label=字数统计($Word Count)...
+complete-word.label=字符自动填写(Co$mplete Word)
+expand-abbrev.label=扩展简写(E$xpand Abbreviation)
+goto-line.label=跳至行($Go to Line)...
+
+#{{{ More Clipboard menu
+clipboard.label=更多的粘贴板(More Clip$board)
+cut-append.label=剪切追加($Cut Append)
+copy-append.label=复制追加(C$opy Append)
+vertical-paste.label=垂直粘贴($Vertical Paste)
+paste-previous.label=粘贴之前内容(Paste Previo$us)...
+paste-deleted.label=粘贴删除内容(Paste $Deleted)...
+paste-special.label=粘贴特殊...
+cut-string-register.label=剪切到寄存器(Cu$t to Register)
+copy-string-register.label=复制到寄存器(Co$py to Register)
+paste-string-register.label=粘贴寄存器(Paste $Register)
+clear-string-register.label=清除寄存器
+cut-append-string-register.label=剪切追加到寄存器(Cut Appe$nd to Register)
+copy-append-string-register.label=复制追加到寄存器(Copy $Append to Register)
+vertical-paste-string-register.label=垂直复制寄存器(V$ertical Paste Register)
+view-registers.label=查看寄存器(Vie$w Registers)
+#}}}
+
+#{{{ More Selection menu
+selection.label=更多选择(More $Selection)
+select-none.label=不选(Select $None)
+select-word.label=选择单词(Select $Word)
+select-line.label=选择行(Select $Line)
+select-paragraph.label=选择段落(Select $Paragraph)
+invert-selection.label=置换选择($Invert Selection)
+toggle-multi-select.label=多项选择($Multiple Selection)
+toggle-rect-select.label=矩形选择($Rectangular Selection)
+select-line-range.label=选择行范围(Sele$ct Line Range)...
+#}}}
+
+#{{{ Text menu
+text.label=文本($Text)
+delete-line.label=删除行($Delete Lines)
+delete-start-line.label=删除行首(Delete to $Start of Line)
+delete-end-line.label=删除行尾(Delete to $End of Line)
+join-lines.label=连接行($Join Lines)
+delete-paragraph.label=删除段落(Delete $Paragraph)
+format-paragraph.label=格式化段落($Format Paragraph)
+to-lower.label=转换为小写(To $Lower Case)
+to-upper.label=转化为大写(To $Upper Case)
+#}}}
+
+#{{{ Indent menu
+indent.label=缩进($Indent)
+indent-lines.label=行缩进($Indent Lines)
+shift-left.label=左缩进(Shift Indent $Left)
+shift-right.label=右缩进(Shift Indent $Right)
+remove-trailing-ws.label=删除尾随空白(Remove Trailing $Whitespace)
+spaces-to-tabs.label=空白转制表符($Spaces to Tabs)
+tabs-to-spaces.label=制表符转空白符($Tabs to Spaces)
+#}}}
+
+#{{{ Source menu
+source.label=源(Sourc$e)
+range-comment.label=范围内注释($Range Comment)
+line-comment.label=行注释($Line Comment)
+select-block.label=选择代码块($Select Code Block)
+match-bracket.label=跳至匹配的括号(Go to $Matching Bracket)
+prev-bracket.label=跳至先前的括号(Go to $Previous Bracket)
+next-bracket.label=跳至下一个括号(Go to $Next Bracket)
+#}}}
+
+#}}}
+
+#{{{ Search menu
+search.label=搜索($Search)
+find.label=查找($Find...)
+find-next.label=查找下一个(Fi$nd Next)
+find-prev.label=查找先前的(Find Pre$vious)
+search-in-open-buffers.label=在当前内容中查找(Search in Open $Buffers)...
+search-in-directory.label=在路径下搜索(Search in $Directory)...
+replace-in-selection.label=替换选择($Replace in Selection)
+replace-and-find-next.label=替换并且查找下一个(Re$place and Find Next)
+replace-all.label=替换全部(Replace $All)
+quick-search.label=增量搜索栏($Incremental Search Bar)
+hypersearch.label=超级搜索栏($HyperSearch Bar)
+quick-search-word.label=增量搜索单词(I$ncremental Search for Word)
+hypersearch-word.label=超级单纯搜索(H$yperSearch for Word)
+whole-word.label=整体单词($Whole Word)
+ignore-case.label=忽略大小写(Ignore $Case)
+regexp.label=正则表达式(Regular E$xpressions)
+hypersearch-results.label=超级搜索结果(HyperSearch Results)
+#}}}
+
+#{{{ Markers menu
+markers.label=标记($Markers)
+add-marker.label=添加/删除 标记($Add/Remove Marker)
+add-marker-shortcut.label=添加标记快捷键(Add Marker $With Shortcut)
+remove-all-markers.label=移除所有标记(Re$move All Markers)
+goto-marker.label=跳至标记($Go to Marker)
+select-marker.label=选择到标签($Select to Marker)
+swap-marker.label=换插入符号和标记(Swa$p Caret and Marker)
+prev-marker.label=跳转至先前标记(Go to $Previous Marker)
+next-marker.label=跳转至下一个标记(Go to $Next Marker)
+no-markers.label=无标记
+markers.blank-line=[空行]([Blank line])
+#}}}
+
+#{{{ Folding menu
+folds.label=折叠(F$olding)
+collapse-fold.label=收起折腾($Collapse Fold)
+expand-one-level.label=展开第一层折叠($Expand Fold One Level)
+expand-fold.label=完全展开折叠(Expand $Fold Fully)
+collapse-all-folds.label=收起所有折叠(Collapse $All Folds)
+expand-folds.label=展开层级折叠(Expand Fo$lds With Level)
+expand-all-folds.label=扩展所有折叠(E$xpand All Folds)
+select-fold.label=选择折叠($Select Fold)
+add-explicit-fold.label=添加明显折叠(A$dd Explicit Fold)
+narrow-to-fold.label=收缩到折叠(Na$rrow to Fold)
+narrow-to-selection.label=收缩到选择(Narro$w to Selection)
+parent-fold.label=跳至父节点($Go to Parent Fold)
+prev-fold.label=跳转至先前节点(Go to $Previous Fold)
+next-fold.label=跳转至下一个节点(Go to $Next Fold)
+#}}}
+
+#{{{ View menu
+view.label=视图($View)
+new-view.label=新建视图(New $View)
+new-view.tooltip=新建带可停靠窗口的主窗口
+new-plain-view.label=新建空白视图(Ne$w Plain View)
+new-plain-view.tooltip=新建带少量工具条和无可停靠窗口的主窗口
+close-view.label=关闭视图($Close View)
+close-view.tooltip=关闭主窗口,如果这是唯一视图,退出jEdit
+prev-buffer.label=跳至先前内容(Go to $Previous Buffer)
+next-buffer.label=跳至下一个内容(Go to $Next Buffer)
+recent-buffer.label=跳转至最近内容(Go to $Recent Buffer)
+toggle-buffer-switcher.label=切换内容(Toggle $Buffer Switcher)
+focus-buffer-switcher.label=聚焦缓冲切换(Focus on Buffer S$witcher)
+toggle-line-numbers.label=切换行号(Toggle $Line Numbers)
+toggle-statusbar.label=切换状态栏(Toggle S$tatus Bar)
+toggle-gutter.label=切换装订线(Toggle $Gutter)
+show-context-menu.label=显示上下文菜单
+set-view-title.label=设置视图标题...
+set-view-title.tooltip=设置主窗口标题以方便识别
+toggle-full-screen.label=切换全屏模式(Toggle $full-screen mode)
+
+#{{{ Scrolling menu
+scrolling.label=滚动(Scrollin$g)
+scroll-to-current-line.label=滚动到当前行(Scroll $to Current Line)
+scroll-and-center.label=滚动到插入符中心($Scroll and Center Caret)
+center-caret.label=调整插入符到屏幕中心($Center Caret on Screen)
+scroll-up-line.label=向上滚动行(Line Scroll $Up)
+scroll-down-line.label=向下滚动行(Line Scroll $Down)
+scroll-up-page.label=向上滚动页(Page Scroll U$p)
+scroll-down-page.label=向下滚动页(Page Scroll D$own)
+#}}}
+
+#{{{ Splitting menu
+splitting.label=拆分($Splitting)
+split-horizontal.label=水平拆分(Split $Horizontally)
+split-vertical.label=垂直拆分(Split $Vertically)
+unsplit-current.label=取消当前拆分($Unsplit Current)
+unsplit.label=取消所有拆分(Unsplit $All)
+resplit.label=恢复拆分($Restore Split)
+prev-textarea.label=跳转至先前文本区域(Go to $Previous Text Area)
+next-textarea.label=跳转至下一个文本区域(Go to $Next Text Area)
+buffersets.label=缓冲集($Buffer Sets)
+global-bufferset.label=全局缓冲集($Global Scope BufferSets)
+global-bufferset.tooltip=所有编辑面板共享缓冲集.
+view-bufferset.label=查看范围内缓冲集($View Scope BufferSets)
+view-bufferset.tooltip=同一个视图下的编辑面板共享缓冲集.
+editpane-bufferset.label=编辑面板范围内缓冲集($EditPane Scope BufferSets)
+editpane-bufferset.tooltip=编辑面板拥有独立缓冲集.
+#}}}
+
+#{{{ Docking menu
+docking.label=停靠($Docking)
+docking.menu.label=可停靠菜单
+toggle-dock-areas.label=切换停靠的区域(Toggle Docked $Areas)
+left-docking-area.label=跳转到左边停靠区域(Go to $Left Docking Area)
+top-docking-area.label=跳转到顶部停靠区域(Go to $Top Docking Area)
+right-docking-area.label=跳转到右边停靠区域(Go to $Right Docking Area)
+bottom-docking-area.label=跳转到底部停靠区域(Go to $Bottom Docking Area)
+focus-textarea.label=跳转至文本区域
+close-docking-area.label=关闭当前停靠区域($Close Current Docking Area)
+layout-load.label=载入可停靠布局($Load docking layout) ...
+layout-save.label=保存可停靠布局($Save docking layout) ...
+layout-load-current-mode.label=载入当前模式下可停靠布局
+layout-save-current-mode.label=保存当前模式下可停靠布局
+#}}}
+
+#}}}
+
+#{{{ Utilities menu
+
+utils.label=工具集($Utilities)
+vfs.browser.label=文件浏览器($File System Browser)
+action-bar.label=动作栏($Action Bar)
+last-action.label=重复上一次动作(Re$peat Last Action)
+buffer-options.label=缓冲区选项($Buffer Options)...
+global-options.label=全局选项($Global Options)...
+combined-options.label=选项集($Options)...
+
+#{{{ Recent Directories menu
+recent-directories.label=最近目录($Recent Directories)
+no-recent-dirs.label=无最近目录
+#}}}
+
+#{{{ Favorites menu
+favorites.label=喜好(Fa$vorites)
+add-buffer-to-favorites.label=添加内容去喜好
+add-dir-to-favorites.label=添加目录到喜好
+edit-favorites.label=编辑喜好
+#}}}
+
+#{{{ Current Directory menu
+current-directory.label=当前目录($Current Directory)
+#}}}
+
+#{{{ jEdit Home Directory menu
+jedit-directory.label=jEdit 根目录($jEdit Home Directory)
+#}}}
+
+#{{{ Settings Directory menu
+settings-directory.label=设置目录($Settings Directory)
+#}}}
+
+#{{{ BeanShell menu
+beanshell.label=B$eanShell
+eval.label=计算BeanShell表达式($Evaluate BeanShell Expression)...
+eval-for-selected-lines.label=计算选择行(Evaluate $For Selected Lines)...
+eval-selection.label=计算所选择区域(Evaluate $Selection)
+#}}}
+
+#{{{ Troubleshooting menu
+troubleshooting.label=故障排除($Troubleshooting)
+log-viewer.label=活动日志($Activity Log)
+update-log.label=更新磁盘上活动日志($Update Activity Log on Disk)
+io-progress-monitor.label=I/O 进程($I/O Progress)
+task-monitor.label=任务监视器($Task Monitor)
+keyboard-tester.label=键盘测试($Keyboard Tester)...
+memory-status.label=内存状态($Memory Status)...
+reload-modes.label=重新加载编辑模式($Reload Edit Modes)
+#}}}
+
+#{{{ Quick options menu
+quick-options.label=快速设置($Quick settings)
+edit-syntax-style.label=在插入符下编辑语法风格
+#}}}
+
+#}}}
+
+#{{{ Macros menu
+macros.label=宏(Ma$cros)
+new-macro.label=新建宏(New Macro)
+record-macro.label=记录宏($Record Macro)...
+stop-recording.label=停止记录($Stop Recording)
+last-macro.label=重复上次宏
+record-temp-macro.label=记录即时宏(Record $Temporary Macro)
+run-temp-macro.label=运行即时宏(Run Tem$porary Macro)
+run-other-macro.label=运行其它宏(Run $Other Macro)...
+rescan-macros.label=重新扫描宏(Resca$n Macros)
+no-macros.label=无宏
+#}}}
+
+#{{{ Plugins menu
+plugins.label=插件($Plugins)
+plugin-manager.label=插件管理器(Plugin $Manager)...
+plugin-options.label=插件选项(Plugin $Options)...
+no-plugins.label=没有安装选项
+#}}}
+
+#{{{ Help menu
+help-menu.label=帮助($Help)
+about.label=关于jEdit($About jEdit)...
+help.label=jEdit帮助(jEdit $Help)
+tip-of-the-day.label=每日小提示($Tip of the Day)
+userFeedback.label=提出建议...
+#}}}
+
+#}}}
+
+#{{{ Macro strings
+
+macro.temp.header=// This is a temporary macro. First, check over the\n\
+		  // commands to make sure this is what you intended.\n\
+		  // Then, to run this macro, switch to the buffer\n\
+		  // where you would like to execute it and press C+m C+p.
+
+macro.header=// This is a recorded macro. First, check over the\n\
+	     // commands to make sure this is what you intended. Then,\n\
+	     // save this buffer, and the macro should appear in the\n\
+	     // Macros menu.
+
+#}}}
+
+#{{{ Commands that don't appear in menus
+backspace-word.label=删除先前单词
+backspace-word-std.label=删除先前单词(删除空白符)
+backspace-word-std-after.label=删除先前单词(删除单词后空白符)
+backspace.label=删除先前字符
+delete-word.label=删除下一个单词
+delete-word-std.label=删除下一个单词(删除空白符)
+delete.label=删除下一个字符
+document-end.label=删除内容尾
+document-home.label=跳至内容开头
+end.label=结尾
+home.label=开头
+smart-end.label=智能结尾
+smart-home.label=智能开头
+insert-literal.label=逐字插入下一个字符
+insert-newline.label=插入换行符
+insert-newline-indent.label=插入换行符和缩进
+insert-tab.label=插入标签
+insert-tab-indent.label=插入标签和缩进
+line-end.label=跳至行尾
+line-home.label=跳至行首
+next-char.label=跳至下一个字符
+next-line.label=跳至下一行
+next-page.label=跳至下一页
+next-paragraph.label=跳至下一个段落
+next-word.label=跳至下一个单词
+next-word-std.label=跳至下一个单词(删除空白符)
+overwrite.label=覆盖模式
+prev-char.label=跳至前一个字符
+prev-line.label=跳至前一行
+prev-page.label=跳至先前一页
+prev-paragraph.label=跳至前一段落
+prev-word.label=跳至前一个单词
+prev-word-std.label=跳至前一个单词(删除空白符)
+prev-word-std-after.label=跳至前一个单词(删除单词后空白符)
+select-document-end.label=选择内容结尾
+select-document-home.label=选择内容开头
+select-end.label=选择智能结尾位置
+select-home.label=选择智能开头位置
+select-line-end.label=选择行尾
+select-line-home.label=选择行首
+select-next-char.label=选择下一个字符
+select-next-line.label=选择下一行
+select-next-page.label=选择下一页
+select-next-paragraph.label=选择下一段落
+select-next-word.label=选择下一个单词
+select-next-word-std.label=选择下一个单词(删除空白字符)
+select-prev-char.label=选择前一个字符
+select-prev-line.label=选择前一行
+select-prev-page.label=选择前一页
+select-prev-paragraph.label=选择前一个段落
+select-prev-word.label=选择前一个单词
+select-prev-word-std.label=选择前一个单词(删除空白符)
+select-prev-word-std-after.label=选择前一个单词(删除单词后空白符)
+select-visible-end.label=选择最后一个可视行
+select-visible-home.label=选择第一个可视行
+select-whitespace-end.label=选择空白符尾
+select-whitespace-home.label=选择空白符首
+toggle-line-separator.label=切换行分隔符
+toggle-word-wrap.label=切换自动换行
+visible-end.label=跳至最后一个可视行
+visible-home.label=跳至第一个可视行
+whitespace-end.label=跳至空白符尾
+whitespace-home.label=跳至空白符首
+#}}}
+
+#{{{ View stuff
+
+# Title
+view.title=jEdit -\u0020
+view.title.dirty=\ (modified)
+
+view.docking.close-tooltip=停靠当前可停靠窗口
+view.docking.menu-tooltip=可停靠窗口选项
+view.docking.menu-floating=悬浮
+view.docking.menu-top=停靠在顶部
+view.docking.menu-left=停靠在左边
+view.docking.menu-bottom=停靠在底部
+view.docking.menu-right=停靠在右边
+view.docking.menu-clone=新的浮动窗体
+view.docking.menu-close=关闭
+view.docking.menu-undock=取消停靠
+
+view.docking.toggle.label={0} (切换)
+view.docking.float.label={0} (新的浮动窗体)
+
+directory.not-local=远程文件系统上无法列出目录
+directory.no-files=没有文件
+
+#{{{ Gutter highlight
+view.gutter.marker.no-name=标记
+view.gutter.marker=标记: {0}
+#}}}
+
+#{{{ Status messages
+view.status.add-marker=为新标记创建快捷键? [{0}]
+view.status.auto-wrap=搜索的字符没有找到;在附近搜索!
+view.status.bracket=匹配行 {0}: {1}
+view.status.caret-tooltip=Offset, line and column number (offset,line,column[-virtual] relative%)
+view.status.copy-append-string-register=追加复制寄存器名? [{0}]
+view.status.copy-string-register=要复制的寄存器? [{0}]
+view.status.cut-append-string-register=追加剪切寄存器? [{0}]
+view.status.cut-string-register=要剪切的寄存器? [{0}]
+view.status.expand-folds=折叠层次? [1-9]
+view.status.goto-marker=输入标记快捷键以跳转? [{0}]
+view.status.incomplete-abbrev=指定参数:{0}, 但是需要 {1}!
+view.status.insert-literal=逐字插入键?
+view.status.io-1=I/O: 一个操作在运行中
+view.status.io.done=输入/输出完成
+view.status.io=I/O: {0} 操作在进行中
+view.status.linesep-changed=行分隔符设置为 {0}
+view.status.linesep-tooltip=行分隔符 (点击以改变)
+view.status.memory-tooltip=Java 堆内存: {0}Kb/{1}Kb
+view.status.mode-tooltip=当前编辑模式,折叠模式,以及编码
+view.status.multi-changed=多项选择模式 {0,choice,0#off|1#on}
+view.status.multi-tooltip=多项选择模式 (点击以改变)
+view.status.narrow=调用"展开所有折叠"已使所有文本可见
+view.status.no-markers=没有标记组
+view.status.no-registers=没有定义寄存器
+view.status.overwrite-changed=重载模式是 {0,choice,0#off|1#on}
+view.status.overwrite-tooltip=覆盖/插入模式指示器(点击更改)
+view.status.paste-string-register=从寄存器粘贴? [{0}]
+view.status.print=打印页面 {0}
+view.status.quick-copy=快速复制模式-标记的文本将替换选择内容
+view.status.recording=正在记录宏
+view.status.rect-select-changed=矩形选择内容是 {0,choice,0#off|1#on}
+view.status.rect-tooltip=矩形选择模式 (点击更换)
+view.status.replace-all=在{1}文件中替换了{0}次出现
+view.status.search-not-found=所搜索字符串没有找到!
+view.status.select-marker=所选标记的快捷键? [{0}]
+view.status.swap-marker=切换光标到标记的快捷键? \
+	[{0}]
+view.status.vertical-paste-string-register=垂直粘贴的寄存器 \
+	from? [{0}]
+view.status.wrap-changed=自动换行模式现在是 "{0}"
+view.status.wrap-tooltip=<html>自动换行模式 {0} (点击以改变)</html>
+view.status.indent-tooltip=自动缩进指示(点击更换)
+view.status.autoindent-changed=自动缩进状态是"{0}"
+view.status.bufferset-tooltip=内容范围是 {0}
+wrap.none=禁用
+wrap.hard=硬
+wrap.soft=软
+#}}}
+
+#{{{ Status bar component visibility
+
+#}}}
+
+#}}}
+
+#{{{ Printing
+
+print.headerText=jEdit - {0}
+print.footerText={0} :: 页 {1}
+
+print-error.title=打印错误
+print-error.message=一个错误发生在打印:\n\
+	{0}
+#}}}
+
+#{{{ Various dialog boxes
+
+#{{{ About dialog
+about.title=关于 jEdit
+about.version=jEdit {0} {1} 模式, 使用 {2} Java {3}
+about.mode.standalone=独立	
+about.mode.server=服务器
+about.mode.server-background=服务器背景
+about.navigate=按箭头键来浏览有关文本
+
+# This text scrolls by in the about dialog box.
+# Hack: Since StringTokenizer treats two consequent \n as one token, we
+# insert a space by itself in the text to create blank lines.
+about.text.prefix=jEdit 开发人员是
+about.text.suffix=我也非常感谢用户的评价,回馈以及BUG 报告.
+#}}}
+
+#{{{ Error list dialog, used to report I/O and plugin load errors
+error-list.plugin-manager=插件管理器
+#}}}
+
+#{{{
+largeBufferDialog.title=大数据内容 {0}
+largeBufferDialog.message=由于内容太大,jEdit可能未响应\n\
+	由于语法高亮. 你应该考虑以下选项\n\
+	-保留所有高亮:jEdit的语法高亮将要正常工作, jEdit \n\
+	可能变得非常慢,这个选项不推荐.\n\
+	-上下文不敏感的语法高亮. 在这种情况下, jEdit 将要\n\
+	做快速高亮, 但是结果可能不完美. \n\
+	内容讲在不检查上下文的情况下被高亮\n\
+	语法可能不准确\n\
+	如果你在多行上有标记 (多行注释, xml 标签 ...)\n\
+	-使用jEdit的'文本'模式 (无语法高亮)
+largeBufferDialog.fullSyntax=保留所有高亮
+largeBufferDialog.contextInsensitive=上下文不敏感的语法高亮
+largeBufferDialog.defaultMode=文本编辑模式
+#}}}
+
+#{{{ I/O error dialog box
+ioerror.title=I/O 错误
+ioerror.caption=以下 {0} I/O 操作不能完成:
+ioerror.caption-1=以下 I/O 操作不能完成:
+
+ioerror={0}
+ioerror.directory-error=无法列出目录: {0}
+ioerror.directory-error-nomsg=无法列出目录.
+ioerror.encoding-error=文件在编码 "{0}"下无法\n\正确加载(一下数据可能丢失了) \n\
+	({1})\n\
+	尝试选择不同的编码.\n\
+	你可以从目录->重新加载编码 下选择.\n\
+	如果你想要系统自动完成, 将候选编码加入\n\
+	"后备编码列表" (在全局选项的编码面板下).
+ioerror.write-encoding-error=无法对\n\
+	{3} 在列 {2} 行 {1} 的字符使用编码 "{0}"进行编码.
+ioerror.read-error=无法加载: {0}
+ioerror.write-error=无法保存: {0}
+ioerror.unsupported-encoding-error={0} 字符集不支持你的JVM
+ioerror.open-directory=无法以内容形式打开目录.
+ioerror.save-directory=无法将内容保存为目录.
+ioerror.no-read=没有足够的权限加载文件.
+ioerror.no-write=没有足够的权限保存文件.
+ioerror.write-error-readonly=无法保存,该文件只读.
+ioerror.save-readonly-twostagefail=无法保存,文件只读并且无法进行两阶段保存.
+ioerror.badurl=异常 URL: {0}
+ioerror.delete-error=无法删除文件.
+ioerror.rename-exists=无法覆盖已存文件 {0}.
+ioerror.rename-error=无法重命名为 {0}.
+ioerror.mkdir-error=无法创建目录.
+ioerror.backup-failed=备份失败,选择"保存与备份"选项.
+ioerror.backup-same-name=备份名与原文件一致.
+ioerror.copy-self=破坏性操作,自我复制文件,遭到拒绝: {0}
+
+vfs.not-supported.list="{0}"文件系统下目录无法浏览.
+vfs.not-supported.load="{0}"文件系统下文件无法打开.
+vfs.not-supported.save="{0}"文件系统下文件无法保存.
+
+vfs.overwrite-readonly.title=该文件只读
+vfs.overwrite-readonly.message=文件 {0} 只读.\n\
+	你是否仍然要保存,重设只读标签\n\
+	将使用二阶段保存(在UNIX下重设文件拥有者)
+
+vfs.twostageimpossible.title=二阶段保存不能使用
+vfs.twostageimpossible.message=二阶段保存不能使用,你仍然要保存?\n\
+
+out-of-memory-error=没有足够的Java堆内存来完成\n\
+	该请求. 尝试增加堆内存.\n\
+	\n\
+	改变堆内存的文档在D\n\
+	 user guide的"jEdit Basics"章的"Buffers" 节里.\n\
+	
+#}}}
+
+#{{{ Old I/O error dialog boxes
+ioerror.message=一个 I/O 错误发生d ({0})
+
+read-error.title=读错误
+# {0} - the path name {1} - the error message
+read-error.message=文件 {0}\n\
+	由于一个 I/O 错误无法加载.\n\
+	({1})
+
+write-error.title=写错误
+# {0} - the path name {1} - the error message
+write-error.message=文件 {0}\n\
+	由于一个 I/O 错误无法保存.\n\
+	({1})
+
+directory-error.title=目录错误
+# {0} - the path name {1} - the error message
+directory-error.message=目录 {0}\n\
+	由于一个 I/O 错误无法列出.\n\
+	({1})
+
+directory-error-nomsg.title=目录错误
+# {0} - the path name
+directory-error-nomsg.message=目录 {0}\n\
+	c由于一个 I/O 错误无法列出.
+
+encoding-error.title=不兼容的编码
+encoding-error.message=文件 {0}\n\
+	无线在 "{1}" 编码下加载.\n\
+	({2})\n\
+	\n\
+	要使用不同的编码, 尝试在\n\
+	文件->打开编码菜单 下的指令.\n\
+	\n\
+	如果你真的不知道要使用什么编码\n\
+	, 尝试使用 "ASCII" 或者 "8859_1".
+
+open-directory.title=无法使用目录
+open-directory.message={0} 是一个目录.\n\
+	目录无法打开编辑.
+
+save-directory.title=无法删除目录
+save-directory.message={0} 是一个目录.\n\
+	编辑内容无法保存为其它目录上.
+
+no-read.title=无法打开文件
+no-read.message=无法从 {0}读取.\n\
+	这可能是由于你没有足够的权限.
+
+no-write.title=无法保存文件
+no-write.message=无法保存到 {0}.\n\
+	这可能是由于你没有足够的权限.
+
+badurl.title=无效的URL
+# {0} - the URL
+# {1} - the error
+badurl.message=以下 URL 是无效的: {0}\n\
+	({1})
+#}}}
+
+#{{{ Go to line dialog
+goto-line.title=跳至行
+goto-line.message=跳至行({0} - {1}):
+#}}}
+
+#{{{ Word count dialog
+wordcount.title=字数统计
+# {0} - characters
+# {1} - words
+# {2} - lines
+wordcount.message=字符: {0}\n单词: {1}\n行: {2}
+#}}}
+
+#{{{ Set marker dialog
+setmarker.title=设置标记
+setmarker.message=标记名称:
+#}}}
+
+#{{{ File not saved dialog
+notsaved.title=文件未保存
+# {0} - file name
+notsaved.message=保存改变到 {0}?
+#}}}
+
+#{{{ File changed, still reload dialog
+changedreload.title=文件以更新
+changedreload.message=文件 {0}\n\
+	在上次保存时已改变; 如果你重新加载,\n\
+	改变将丢失. 继续?
+#}}}
+
+#{{{ Autosave file exists dialog
+autosave-found.title=找到自动保存文件
+# {0} - autosave file name
+autosave-found.message=发现自动保存文件 {0}\n\! 这可能是由于jEdit在未保存前崩溃了.\n\
+	你想要打开自动保存文件吗?
+
+autosave-loaded.title=已加载自动保存文件
+autosave-loaded.message=自动保存文件 {0}\n\
+	已加载. 你现在应该检查它是否包含你未保存的数据\n\
+	. 如果你想要保存自动保存文件的改名,请保存文件\n\
+	否则, 选择 文件->重新加载.
+#}}}
+
+#{{{ Save all confirm dialog
+saveall.title=保存所有内容
+saveall.message=你确定要保存已改变的文件吗?
+#}}}
+
+#{{{ Reload all confirm dialog
+reload-all.title=加载所有内容	
+reload-all.message=你确定要从硬盘重新加载所有内容吗?\n\
+	所有打开文件的改变将要丢失!
+#}}}
+
+#{{{ Encoding prompt
+encoding-prompt.title=使用其它编码打开
+encoding-prompt.message=字符编码使用:
+#}}}
+
+#{{{ Macro recording already in progress dialog
+already-recording.title=已经在记录中
+already-recording.message=一个宏记录已经在进行中.
+#}}}
+
+#{{{ No temporary macro dialog
+no-temp-macro.title=没有即时宏
+no-temp-macro.message=没有记录的即时宏.
+#}}}
+
+#{{{ Record macro dialog
+record.title=记录宏
+record.message=宏名称:
+#}}}
+
+#{{{ Some features don't work with -nosettings dialog
+no-settings.title=特征未启用
+no-settings.message=jEdit初始化时使用了-无设置 开关.\n\
+	要使用这些特征,你必须在关闭这个开关的情况下启动jEdit.
+#}}}
+
+#{{{ Some features don't work with the web start version
+no-webstart.title=特征未启用
+no-webstart.message=该特征无法在WebStart版本中使用\n\
+#}}}
+
+#{{{ Search and replace dialog
+search.title=搜索和替换
+
+search.find=搜索:
+search.find.tooltip=PgUp/PgDown 或者右键单击恢复以前查询
+search.find.mnemonic=s
+search.replace=替换内容:
+search.replace.mnemonic=w
+search.string-replace-btn=文本
+search.beanshell-replace-btn=返回一个BeanShell片段值
+
+search.settings=设置:
+search.keep=保留对话框
+search.keep.mnemonic=k
+search.word=全部单词 (q)
+search.word.bar=全部单词
+search.word.mnemonic=q
+search.case=忽略大小写
+search.case.mnemonic=i
+search.regexp=正则表达式
+search.regexp.mnemonic=x
+search.hypersearch=超级搜索
+search.hypersearch.mnemonic=h
+search.wrap=自动换行
+search.wrap.mnemonic=t
+
+search.direction=方向:
+search.back=后退
+search.back.mnemonic=b
+search.forward=前进
+search.forward.mnemonic=o
+
+search.fileset=搜索范围:
+search.selection=选择
+search.selection.mnemonic=n
+search.current=当前内容
+search.current.mnemonic=c
+search.all=所有内容
+search.all.mnemonic=l
+search.directory=目录:
+search.directory.mnemonic=d
+search.skipHidden=跳过隐藏文件/备份文件
+search.skipBinary=跳过二进制文件
+search.skipHidden.mnemonic=h
+search.skipBinary.mnemonic=b
+
+search.directoryField=目录:
+search.directoryField.mnemonic=y
+search.filterField=过滤器:
+search.filterField.mnemonic=f
+glob.tooltip={*.c,*.h} 是多个扩展
+search.subdirs=搜索子目录
+search.subdirs.mnemonic=u
+search.choose=选择...
+search.choose.mnemonic=e
+search.synchronize=同步
+search.synchronize.mnemonic=z
+search.synchronize.tooltip=为当前缓冲区的扩展/位置设置过滤器和目录.
+search.findBtn=查找
+search.findBtn.mnemonic=f
+search.replaceBtn=替换
+search.replaceBtn.mnemonic=p
+search.replaceAndFindBtn=替换查找
+search.replaceAndFindBtn.mnemonic=r
+search.replaceAllBtn=替换所有
+search.replaceAllBtn.mnemonic=a
+
+# Beep when searching automatically wraps?
+
+#}}}
+
+#{{{ Keep searching dialog
+keepsearching.title=没有更多的匹配
+keepsearching.message=没有更多的匹配.\n\
+	从{0,choice,0#beginning|1#end}继续搜索?
+#}}}
+
+#{{{ HyperSearch results dialog
+hypersearch-results.title=超级搜索结果
+hypersearch-results.result-caption={0} ({1,choice,1#1 occurrence|1<{1,number,integer} 出现在 '{2,choice,1#1 file|1<{2,number,integer} 文件中}'})
+hypersearch-results.open=打开
+hypersearch-results.open-view=在新视图中打开
+hypersearch-results.open-plain-view=在新的空白视图中打开
+hypersearch-results.open-split=在新的差分中打开
+hypersearch-results.remove-node=移除节点
+hypersearch-results.new-search=从这里开始新的搜索
+hypersearch-results.expand-child-nodes=展开子节点
+hypersearch-results.collapse-child-nodes=折叠子节点
+hypersearch-results.copy-to-clipboard=复制到粘贴板
+hypersearch-results.redo=重做超级搜索
+hypersearch-results.tree-view=切换树视图
+hypersearch-results.clear.label=移除所有节点
+hypersearch-results.stop.label=停止超级搜索并返回当前结果
+hypersearch-results.multi.label=切换多个结果
+hypersearch-results.highlight.label=设置匹配高亮样式
+hypersearch-results.file-caption={0} ({1,choice,1#1 occurrence|1<{1,number,integer} 出现在'{2,choice,1#1 line|1<{2,number,integer} 行}'})
+hypersearch-results.searching=搜索 "{0}"...
+hypersearch-results.no-results=没有结果匹配 "{0}".
+hypersearch-results.done= "{0}"的搜索结果:
+
+hypersearch-status=Searching
+#}}}
+
+#{{{ HyperSearch too many results
+hypersearch.tooManyResults.label=过多结果
+hypersearch.tooManyResults.title=过多结果
+hypersearch.tooManyResults.message=你的搜索返回 {0} \
+	个结果,并且没有结束. 你是否想要停止搜索 ?
+#}}}
+
+
+#{{{ Search and replace error dialog
+searcherror.title=搜索替换错误
+# {0} - error message
+searcherror.message=进行该操作时出现一个错误.
+#}}}
+
+#{{{ Search and replace error dialog
+searcherror-bsh.title=搜索替换错误
+# {0} - error message
+searcherror-bsh.message=进行该操作时出现一个错误.\n\
+	\n\
+	如果你不是要使用BeanShell表达式来替换字符串,确保将替换模式设置成“文本”
+#}}}
+
+#{{{ Empty fileset error dialog
+empty-fileset.title=空文件集
+empty-fileset.message=指定的文件集没有任何文件.\n\
+	请确保文件名过滤器和搜索目录(如果有的话)已正确设置.
+#}}}
+
+#{{{ Can only search local directories dialog
+remote-dir-search.title=未选择本地目录
+remote-dir-search.message=你选择了非本地目录进行搜索.\n\
+	由于网络延迟,这可能会非常慢.\n\
+	你确定要继续吗?
+#}}}
+
+#{{{ "Search in selection" active but nothing selected in text area
+search-no-selection.title=没有选择任何内容
+search-no-selection.message=选择一些文字或停用
+"在选择范围内搜索"选项.
+#}}}
+
+#{{{ Paste previous and paste deleted dialogs
+paste-from-list.whitespace=<whitespace>
+paste-previous.title=粘贴之前内容
+paste-previous.caption=最近复制和粘贴的文本:
+paste-deleted.title=粘贴已删除内容
+paste-deleted.caption=最近删除的文本:
+#}}}
+
+#{{{ File changed on disk dialog
+filechanged-save.title=磁盘上文件已改变
+filechanged-save.message=文件{0}\n\
+	在磁盘上已经被其他程序改变. \n\
+	你确定要继续保存它?
+#}}}
+
+#{{{ File exists dialog
+fileexists.title=文件已存在
+fileexists.message=文件 {0} 已经存在. 你确定要\n\
+	覆盖它?
+#}}}
+
+#{{{ Select line range dialog
+selectlinerange.title=选择行范围
+selectlinerange.caption=选择行范围:
+selectlinerange.start=开始行:
+selectlinerange.end=结束行:
+#}}}
+
+#{{{ View registers dialog
+view-registers.title=寄存器
+view-registers.caption=寄存器:
+view-registers.clipboard=$ (clipboard)
+view-registers.selection=% (selection)
+view-registers.none=未定义寄存器
+view-registers.register=寄存器:
+view-registers.contents=内容:
+view-registers.undefined=__UNDEFINED__
+#}}}
+
+#{{{ Close all buffers dialog
+close.title=未保存的改变
+close.caption=以下内容存在未保存的改变:
+close.selectAll=全选
+close.selectAll.mnemonic=a
+close.save=保存选择的内容
+close.save.mnemonic=s
+close.discard=抛弃选择的内容
+close.discard.mnemonic=d
+#}}}
+
+#{{{ Files changed on disk dialog
+files-changed.title=磁盘上文件已改变
+files-changed.caption=以下文件在磁盘上被其他程序改变:
+files-changed.deleted=在磁盘上已删除,保存已重建:
+files-changed.changed-auto=自动重新加载:
+files-changed.changed=磁盘上文件已改变:
+files-changed.changed-dirty-auto=内容紊乱,未重新加载:
+files-changed.changed-dirty=内容紊乱,磁盘上文件已改变:
+files-changed.select-all=全选
+files-changed.select-all.mnemonic=a
+files-changed.reload=重新加载
+files-changed.reload.mnemonic=r
+files-changed.ignore=忽略
+files-changed.ignore.mnemonic=i
+#}}}
+
+#{{{ Abbrev dialogs
+add-abbrev.title=添加缩写
+add-abbrev.mode=添加特定模式
+add-abbrev.global=添加全局化缩写
+
+edit-abbrev.title=编辑缩写
+
+edit-abbrev.duplicate.title=重复缩写
+edit-abbrev.duplicate.message=\
+	该缩写已存在\n\
+	\n\
+	你想要覆盖当前缩写?
+
+abbrev-editor.abbrev=缩写:
+abbrev-editor.before=插入符前要插入的文本:
+abbrev-editor.after=插入符后要插入的文本:
+#}}}
+
+#{{{ XMode errors
+xmode-error.title=XML 解析错误
+# {2} is the column number, but it's not too useful so we don't show it
+xmode-error.message=在解析 {0}的时候发生错误, 行 {1}:\n\
+	{3}
+xmode-error.dtd=DTD 无法加载\n({0})
+xmode-error.termchar-invalid= AT_CHAR 属性值无效 ({0})
+xmode-error.doctype-invalid=预期的模式的文档类型, 发现 {0}
+xmode-error.empty-tag={0} 标签不能为空
+xmode-error.token-invalid=token 类型 {0} 无效
+xmode-error.empty-keyword=关键词文本不能为空
+xmode-error.regexp=无效的正则表达式\n({0})
+xmode-error.hash-char-and-hash-chars-mutually-exclusive=HASH_CHAR 和 HASH_CHARS 可能都未指定
+xmode-error.delegate-invalid=无效的代理: {0}
+#}}}
+
+#{{{ JARClassLoader errors
+plugin-error.title=插件错误
+plugin-error.caption=以下插件无法加载:
+plugin-error.caption-1=以下插件无法加载:
+
+plugin-error.load-error=无法加载: {0}\n\
+	最可能的原因是 JAR 文件已损坏; \n\
+	请尝试重新安装. 请参阅 工具集->故障排除 - >活动日志\n\
+	以查看一个完整的堆栈跟踪.
+plugin-error.start-error=无法打开: {0}\n\
+	请尝试安装更新的版本.
+plugin-error.already-loaded=安装了两个相同插\n\
+	请尝试移除其中一个
+plugin-error.dep-jdk=需要 Java {0} 或者更新版本, 但你只有版本 {1}.
+plugin-error.dep-jedit=需要 jEdit {0} 或者更新版本, 但你只有版本 {1}.\n\
+	从<http://www.jedit.org>下载jEdit最新版本.
+plugin-error.dep-plugin.no-version=需要版本 {0} \
+	或者 {1}的最新版本,\n\
+	但是 {1} 没有安装.
+plugin-error.dep-plugin.broken=需要 {0}, 但是 {0}\n\
+	无法.
+plugin-error.dep-plugin=需要版本 {0} 或者 {1}的最新版本, \
+	但你只有 {1} 的版本 {2}.
+plugin-error.dep-class=需要类 {0}.\n\
+	请尝试安装合适的插件或者类库.
+plugin-error.missing-jar=需要 JAR 文件 {0}.\n\
+	该JAR文件是该插件的一部分,但是无法找到.\n\
+	请尝试重新安装该插件.
+plugin-error.not-42=该插件不支持动态加载.\n\
+	在删除或者安装该插件后,你必须重启jEdit.
+
+plugin-error-download.title=插件错误
+plugin-error-download.message=下载插件时出现错误,请尝试其它镜像\n{0}
+#}}}
+
+#{{{ Macro dialogs
+macro-input.title=宏输入
+macro-error.title=宏错误
+macro-message.title=宏消息
+macro-confirm.title=宏确认
+#}}}
+
+#{{{ BeanShell stuff
+beanshell-error.title=BeanShell 错误
+beanshell-error.message=发生了一个 BeanShell 错误.
+
+beanshell-eval-input.title=测试BeanShell的表达式
+beanshell-eval-input.message=BeanShell 表达式:\n\
+	\n\
+	变量:\n\
+	view - 当前视图实例\n\
+	editPane - 目前编辑窗格实例\n\
+	textArea - 目前的文本区域实例\n\
+	buffer - 当前内容
+
+beanshell-eval.title=BeanShell 评估
+beanshell-eval.message={0}
+
+beanshell-eval-line.title=测试 BeanShell 表达式
+beanshell-eval-line.message=使用BeanShell 表达式对每个所选行 \
+	进行评估:\n\
+	\n\
+	变量:\n\
+	line - 行的索引,从该内容起始开始\n\
+	index - 行的索引,从选择内容起始开始\n\
+	text - 行文本\n\
+	view - 当前视图实例\n\
+	editPane - 目前编辑窗格实例\n\
+	textArea - 目前的文本区域实例\n\
+	buffer - 当前内容
+#}}}
+
+#{{{ Macro not recording dialog
+macro-not-recording.title=没有记录
+macro-not-recording.message=宏当前没有被记录.
+#}}}
+
+#{{{ Large repeat count warning
+large-repeat-count.title=过多重复调用
+large-repeat-count.message=你确定要调用 "{0}" {1} 次?
+
+large-repeat-count.user-input.title=过多重复调用
+large-repeat-count.user-input.message=你确定要插入 "{0}" \
+	{1} 次?
+#}}}
+
+#{{{ Wrong fold mode dialog
+folding-not-explicit.title=错误折叠模式
+folding-not-explicit.message=该指令只能在显式折叠模式下使用.
+#}}}
+
+#{{{ Memory status dialog box
+memory-status.title=Java 堆内存
+memory-status.gc=垃圾内存释放 {0} Kb.
+memory-status.use=消耗{0} Kb , 总共{1} Kb 
+#}}}
+
+#{{{ Multiple I/O request errors
+buffer-multiple-io.title=I/O 错误
+buffer-multiple-io.message=每个内容在同一时间只能执行一个 input/output操作\n\
+	. 在启动一个新的操作前,请等待当前操作结束\n\
+	(或者在I/O 进程监视器退出).\n\
+
+browser-multiple-io.title=I/O 错误
+browser-multiple-io.message=每个文件浏览器在同一时间只能执行一个 input/output操作\n\
+	. 在启动一个新的操作前,请等待当前操作结束\n\
+	(或者在I/O 进程监视器退出).\n\
+#}}}
+
+#{{{ maxLineLen=0 warning
+format-maxlinelen.title=自动行边距
+format-maxlinelen.message=要使此命令工作,请将自动行边距设置0
+#}}}
+
+#{{{ Text under caret does not have a syntax style (token type)
+syntax-style-no-token.title=语法格式设置
+syntax-style-no-token.message=T没有关联的下的文本插入符\
+语法风格配置。
+#}}}
+
+#{{{ View title dialog
+view.title.select=请为该视图输入标题:
+#}}}
+#}}}
+
+#{{{ Buffer options dialog
+buffer-options.title=内容操作
+buffer-options.caption=此对话框只为当前内容更改设置\n \
+。要改变编辑模式的默认设置,请参阅\n \
+全球“选项” - >“编辑窗格。
+buffer-options.loading-saving=正在加载和保存
+buffer-options.lineSeparator=行分隔符:
+buffer-options.encoding=字符编码:
+buffer-options.gzipped=GZIP(压缩)磁盘上的文件
+buffer-options.editing=编辑中
+buffer-options.mode=编辑模式:
+#}}}
+
+#{{{ Global options dialog
+options.title=选项
+options.title-template={0}: {1}
+options.jedit.label=jEdit
+
+# Option pane to show by default
+options.last=编辑中
+
+#{{{ Options groups
+
+#}}}
+
+#{{{ General pane
+options.general.label=普通选项
+options.general.lineSeparator=默认行分隔符:
+options.general.encoding=默认字符编码:
+options.general.encodingAutodetect=可能时自动检测文件编码
+options.general.checkModStatus=打开的文件在磁盘上是否更改:
+options.general.checkModStatus.nothing=什么都不做
+options.general.checkModStatus.prompt=提示
+options.general.checkModStatus.reload=自动重新加载,并通知用户
+options.general.checkModStatus.silentReload=自动重载,不通知用户
+options.general.checkModStatusUpon=检查文件变化:
+options.general.checkModStatusUpon.focus=查看焦点 (检查所有内容)
+options.general.checkModStatusUpon.all=查看焦点或者访问内容
+options.general.checkModStatusUpon.visitBuffer=访问内容
+options.general.checkModStatusUpon.none=没有
+options.general.recentFiles=最近记忆的文件:
+options.general.hypersearch.maxWarningResults=最大超级搜索结果:
+options.general.sortRecent=对最近文件列表排序
+options.general.saveCaret=在最近文件列表保存插入符号的位置
+options.general.persistentMarkers=保存标记位置
+options.general.resetUndo=保存时重新设置撤销的历史
+options.general.restore=启动时恢复以前打开的文件
+options.general.restore.splits=恢复分栏设置
+options.general.restore.remote=... 添加远程VFS文件
+options.general.restore.cli=... 添加命令行指定的文件名
+options.general.encodingDetectors=编码自动探测器列表:
+options.general.fallbackEncodings=后备编码列表:
+options.general.fallbackEncodings.tooltip=处理加载时编码错误的编码列表(空白符隔开)
+options.general.systrayicon=显示系统托盘图标
+#}}}
+
+#{{{ Abbreviations pane
+options.abbrevs.label=缩略语
+options.abbrevs.set=缩写集:
+options.abbrevs.expandOnInput=空格键扩展缩略
+options.abbrevs.abbrev=缩略语
+options.abbrevs.expand=扩展
+options.abbrevs.add=添加...
+options.abbrevs.edit=编辑...
+options.abbrevs.remove=删除
+#}}}
+
+#{{{ Appearance pane
+options.appearance.label=外观
+options.appearance.iconTheme=图标主题:
+options.appearance.fonts.antialias=消除锯齿非文本区域的字体
+options.appearance.lf=Swing 外观和感觉:
+options.appearance.primaryFont=按钮,菜单和标签字体:
+options.appearance.secondaryFont=列表和文本字段字体:
+options.appearance.helpViewerFont=查看帮助/浏览器文本字体:
+options.appearance.history=记住历史文本字段项:
+options.appearance.menuSpillover=菜单移除前的项目数:
+options.appearance.startup.label=启动选项
+options.appearance.showSplash=启动时显示启动画面
+options.appearance.showTips=启动时启动小提示
+options.appearance.experimental.label=实验性选项
+options.appearance.experimental.caption=以下三个选项可能在 \
+	某些Java版本下无法正常工作.\n\
+	如果你遇到了问题,请关闭它们.
+
+options.appearance.textColors=在所有文本组件中使用jEdit文本区域颜色
+options.appearance.decorateFrames=使用Swing的外观和感觉绘制窗口边框
+options.appearance.decorateDialogs=使用Swing外观和感觉绘制对话框边框
+
+options.appearance.localization.section.label=本地化
+options.appearance.usedefaultlocale.label=使用默认本地化
+options.appearance.lang.label=语言 (重启后有效)
+#}}}
+
+#{{{ Context Menu pane
+options.context.label=右键菜单
+options.context.caption=文本区域中的右键菜单项目:
+options.context.add=添加...
+options.context.remove=删除
+options.context.moveUp=上移
+options.context.moveDown=下移
+options.context.reset=设置到默认
+options.context.add.title=添加到右键菜单
+options.context.add.caption=添加到右键菜单:
+options.context.add.separator=分隔符号
+options.context.add.action=指令或者宏:
+options.context.includeOptionsLink.label=包含 "个性化菜单..." 链接
+
+options.context.reset.dialog.title=设置到默认
+options.context.reset.dialog.message=确定要将右键菜单设置到默认?
+#}}}
+
+#{{{ Docking pane
+options.docking.label=可停靠菜单
+options.docking.title=窗口
+options.docking.dockPosition=停靠位置
+options.docking.selectFramework.label=停靠框架:
+options.docking.autoSaveModeLayout.label=自动保存特定模式的停靠布局
+options.docking.autoLoadModeLayout.label=自动加载特定模式的停靠布局
+options.docking.selectSet.label=可停靠设置t:
+options.docking.system-change.note=(实验)重新启动jEdit更改生效
+#}}}
+
+#{{{ Editing pane
+options.editing.label=编辑中
+options.editing.defaultMode=默认编辑模式:
+options.editing.undoCount=撤消次数:
+options.editing.caption-0=\
+	要自定义模式特定的设置,从下面的菜单选择编辑模式。\n \
+	最初显示全局默认值。
+options.editing.caption-1=\
+	取消选中“使用默认设置”以自定义特定模式设置.\n \
+	否则将使用"全局默认值"设置\n \
+options.editing.mode=更改设置模式:
+options.editing.global=<global defaults>
+options.editing.useDefaults=使用默认设置
+options.editing.filenameGlob=全局文件名:
+options.editing.firstlineGlob=全局首行:
+options.editing.folding=折叠模式:
+options.editing.collapseFolds=最初折叠层次:
+options.editing.wrap=自动换行:
+options.editing.maxLineLen=自动边距:
+options.editing.maxLineLen.tooltip=设置 0 为文本区域宽度 (只有在软换行下)
+options.editing.tabSize=表格宽度:
+options.editing.indentSize=缩进宽度:
+options.editing.noWordSep=额外单词字符:
+options.editing.camelCasedWords=分离“驼峰”格式单词
+options.editing.noTabs=软(用空格模拟)标签
+options.editing.elasticTabstops=使用弹性制表位缩进
+options.editing.elasticTabstops.tooltip=单元格上下行中的列对齐制表符,制表符可以根据单元格宽带增大或者缩小.
+options.editing.deepIndent=深缩进
+options.editing.autoIndent=自动缩进
+options.editing.largefilemode.title=大文件模式
+options.editing.largefilemode=关于非常大的文件,我应该怎么办:
+options.editing.largefilemode.option.ask=<html><b>Ask</b> 关于非常大的文件,我应该怎么办</html>
+options.editing.largefilemode.option.full=<html><b>保持完整的语法</b> : jEdit的语法高亮将照常工作, jEdit \
+                                               	可能变得<br/><b>非常慢, 因此不推荐</b></html>
+options.editing.largefilemode.option.limited=<html><b>上下文不敏感的语法高亮</b>: 在此情况下 jEdit 将 \
+		做快速高亮, 但是<br/>结果可能不完美.  \
+		内容可能在没有考虑上下文的情况下进行高亮<br/> \
+		语法有可能不正确 \
+		如果你有<br/>token在多行(多行注释, xml 标签 ...) \
+		软换行也被停用<br/><b>(最好的选择)</b></html>
+options.editing.largefilemode.option.nohighlight=没有语法高亮,没有软换行
+#}}}
+
+#{{{ Encodings pane
+options.encodings.label=编码
+options.encodings.selectEncodings=选择应显示编码对话框的编码:
+options.encodings.available=可用的编码
+options.encodings.selected=选定的编码
+options.encodings.available.tooltip=<html>在此列的编码会 <b>not</b> 显示为编码组合框的选项. 拖到右列来显示它们. </html>
+options.encodings.selected.tooltip=<html>在此列的编码会显示为 jEdit的 GUI的编码组合框的选项. 拖到左列来隐藏它们.</html>
+#}}}
+
+#{{{ Gutter pane
+options.gutter.label=装订线
+options.gutter.enabled=显示装订线
+options.gutter.optionalComponents=可选的装订线组件
+options.gutter.lineNumbers=行号
+options.gutter.minLineNumberDigits=储备行号最小的位数:
+options.gutter.selectionAreaEnabled=当行号未显示时行选择区域
+options.gutter.selectionAreaBgColor=选择区域背景色:
+options.gutter.selectionAreaWidth=选择区域的宽度(以像素为单位):
+options.gutter.font=装订线字体:
+options.gutter.foreground=行号颜色:
+options.gutter.background=背景色:
+options.gutter.borderWidth=装订线边框宽度:
+options.gutter.numberAlignment=行号对齐:
+options.gutter.interval-1=每\u0020 高亮
+options.gutter.interval-2=行:
+options.gutter.currentLineHighlight=高亮当前行:
+options.gutter.structureHighlight=现实结构范围:
+options.gutter.markerHighlight=现实标记位置:
+options.gutter.foldColor=折叠标记:
+options.gutter.focusBorderColor=聚焦装订线边界:
+options.gutter.noFocusBorderColor=未聚焦的装订线边界:
+options.gutter.foldStyle.label=折叠样式:
+options.gutter.foldStyleNames.Triangle=三角
+options.gutter.foldStyleNames.Square=矩形
+options.gutter.foldStyleNames.Circle=原型
+#}}}
+
+#{{{ Mouse pane
+options.mouse.label=鼠标
+options.mouse.dragAndDrop=在文本区域拖放
+options.mouse.joinNonWordChars=双击拖动加入非字母数字字符
+options.mouse.middleMousePaste=使用鼠标中键快速复制
+options.mouse.ctrlForRectangularSelection=按下Ctrl键切换到矩形选择
+options.mouse.gutter.foldClick=点击装订线:
+options.mouse.gutter.SfoldClick=按住Shift键单击装订线:
+options.mouse.gutter.toggle-fold=折叠/展开
+options.mouse.gutter.toggle-fold-fully=完全折叠/展开
+#}}}
+
+#{{{ Plugin Manager pane
+options.plugin-manager.label=插件管理器
+options.plugin-manager.updateMirrors=更新镜像列表
+options.plugin-manager.workthread=更新镜像列表 ...
+options.plugin-manager.downloadSource=下载插件源码
+options.plugin-manager.deleteDownloads=安装后从下载目录删除安装文件
+options.plugin-manager.mirror=首选下载镜像:
+options.plugin-manager.location=插件安装在:
+options.plugin-manager.settings-dir=jEdit 配置目录
+options.plugin-manager.app-dir=jEdit 程序目录
+options.plugin-manager.none=默认插件中心
+options.plugin-manager.disable-obsolete=禁用过时插件
+options.plugin-manager.list-cache.minutes=为插件列表缓存: (minutes)
+#}}}
+
+#{{{ Printing pane
+options.print.label=打印
+options.print.font=打印字体:
+options.print.fontstyle=打印字体样式:
+options.print.fontsize=打印字体大小:
+options.print.header=打印带文件名的页眉
+options.print.footer=打印带日期,时间和页码的页脚
+options.print.lineNumbers=打印行号
+options.print.color=彩色打印
+options.print.tabSize=打印时标签宽度:
+options.print.workarounds=Java错误的解决方法
+options.print.glyphVector=打印间距的解决方法(增加后台打印文件大小)
+options.print.force13=使用旧的打印API(如果jEdit打印时挂起\
+启用此)
+options.print.folds=打印折叠区域
+#}}}
+
+#{{{ Proxy pane
+options.firewall.label=代理服务器
+options.firewall.http.enabled=使用HTTP代理服务器
+options.firewall.http.host=HTTP代理主机:
+options.firewall.http.port=HTTP代理服务器端口:
+options.firewall.http.user=用户名:
+options.firewall.http.password=密码:
+options.firewall.http.nonProxy=直接连接到:
+options.firewall.socks.enabled=使用SOCKS代理服务器
+options.firewall.socks.host=SOCKS代理主机:
+options.firewall.socks.port=SOCKS代理服务器的端口:
+#}}}
+
+#{{{ Save & Backup pane
+options.save-back.label=保存和备份
+
+options.save-back.autosave=自动保存频率(秒):
+options.save-back.backups=最大备份数量:
+options.save-back.backupDirectory=备份目录:
+options.save-back.backupPrefix=备份文件名前缀:
+options.save-back.backupSuffix=备份文件名后缀:
+options.save-back.backupEverySave=每次保存进行备份
+options.save-back.twoStageSave=两个阶段的保存(更安全,但复位文件需要某些文件系统上的所有者权限)
+options.save-back.twoStageSave.tooltip=第1阶段:创建一个临时文件,并保存它。第2阶段:重命名临时文件的真实文件名。
+options.save-back.confirmSaveAll=“保存全部内容“要求进行确认
+options.save-back.autosaveUntitled=自动保存未命名的内容
+options.save-back.suppressNotSavedConfirmUntitled=不给未命名内容标记未混乱文件.
+options.save-back.suppressNotSavedConfirmUntitled.tooltip=检查这意味着每当创建一个新的内容,未命名的内容就被删除(它是一个功能!)
+options.save-back.useMD5forDirtyCalculation=如果内容未改变,不标注内容紊乱.
+options.save-back.useMD5forDirtyCalculation.tooltip=在加载时比较内容长度以及MD5哈希值, 以判断已编辑的内容是否仍然混乱.
+options.save-back.saveAsUsesFSB=“另存为”默认到文件系统浏览器目录
+#}}}
+
+#{{{ Shortcuts pane
+options.shortcuts.deletekeymap.label=删除
+options.shortcuts.deletekeymap.dialog.label=删除键盘映射
+options.shortcuts.deletekeymap.dialog.title=删除
+options.shortcuts.duplicatekeymap.label=重复
+options.shortcuts.duplicatekeymap.dialog.label=选择新的键盘映射名称
+options.shortcuts.duplicatekeymap.keymapalreadyexists.label=这个名字已经存在,请另外选择
+options.shortcuts.duplicatekeymap.dialog.title=键盘映射名称
+options.shortcuts.resetkeymap.label=复位
+options.shortcuts.resetkeymap.dialog.label=重置键盘映射
+options.shortcuts.resetkeymap.dialog.title=重置键盘映射
+options.shortcuts.keymap.label=选择键盘映射:
+options.shortcuts.label=快捷键
+options.shortcuts.select.label=编辑快捷键:
+options.shortcuts.select.tooltip=您可以选择全局,宏或插件快捷方式
+options.shortcuts.name=指令
+options.shortcuts.shortcut1=主快捷键
+options.shortcuts.shortcut2=备选快捷键
+options.shortcuts.filter.label=滤波器:
+options.shortcuts.filter.tooltip=只显示包含该段文字的动作
+options.shortcuts.clear.label=清除
+
+grab-key.title=指定快捷键
+grab-key.caption=按所需的 "{0}"的快捷方式, 然后按确定.
+grab-key.keyboard-test=输入导致问题的按键.
+grab-key.assigned-to=目前分配给: {0}
+grab-key.assigned-to.none=<none>
+grab-key.assigned-to.prefix={0} 前缀
+grab-key.clear=清楚
+grab-key.remove=删除当前
+
+grab-key.remove-ask.title=删除快捷键?
+grab-key.remove-ask.message=\
+	你未指定一个新的快捷键.\n\
+	你是否想要移除当前快捷键?
+
+grab-key.duplicate-alt-shortcut.title=快捷键重复
+grab-key.duplicate-alt-shortcut.message=\
+	选择的快捷键与其他快捷键重复.\n\
+	请选择另一个。
+
+grab-key.duplicate-shortcut.title=快捷键重复
+grab-key.duplicate-shortcut.message=\
+	该快捷键已经分配给\n\
+	"{0}".\n\
+	\n\
+	你想要覆盖它吗?
+
+grab-key.prefix-shortcut.title=无效的快捷键
+grab-key.prefix-shortcut.message=\
+	你无法使用该快捷键, \n\
+	因为它是其他快捷键的前缀.\n\
+	请选择另外一个.
+#}}}
+
+#{{{ Status bar pane
+options.status.label=状态栏
+options.status.visible=显示状态栏
+options.status.plainview.visible=在插件视图显示状态栏
+options.status.foreground=状态栏文本:
+options.status.background=状态栏背景:
+options.status.memory.foreground=内存指示器前景色:
+options.status.memory.background=内存指示器背景:
+options.status.edit.title=编辑状态栏条目
+options.status.edit.labelRadioButton=标签
+options.status.edit.widgetRadioButton=小部件
+options.status.edit.labelLabel=键入一个标签:
+options.status.edit.widgetLabel=选择一个部件:
+options.status.caret.linenumber=显示插入线号
+options.status.caret.dot=显示从行首开始的插入符偏离
+options.status.caret.virtual=显示从行首开始的插入符虚拟偏离
+options.status.caret.offset=显示从文件首开始的插入符偏离
+options.status.caret.bufferlength=显示文件长度
+options.status.caret.title=光标位置显示选项:
+#}}}
+
+#{{{ Syntax Highlighting pane
+options.syntax.label=语法高亮
+options.syntax.object=语汇基元类型
+options.syntax.style=文本样式
+options.syntax.foldLine.1=折叠的折叠线,1级
+options.syntax.foldLine.2=折叠的折叠线,2级
+options.syntax.foldLine.3=折叠的折叠线,3级
+options.syntax.foldLine.0=折叠的折叠线,>3级
+#}}}
+
+#{{{ Text Area pane
+options.textarea.label=文本区域
+options.textarea.font=文本字体:
+options.textarea.fontSubst=可替换的其他字体
+options.textarea.fontSubst.tooltip=搜索可能从已选字体丢失的字形的其它字体(而不是显示矩形)
+options.textarea.fontSubstList=字体替换: 首选字体:
+options.textarea.fontSubstSystemFonts=字体替换:搜索所有的系统字体
+options.textarea.fontSubstWarning.label=字体替换
+options.textarea.fontSubstWarning=没有系统字体,您将需要首选字体.
+options.textarea.foreground=文本颜色:
+options.textarea.background=背景颜色:
+options.textarea.caret=插入符:
+options.textarea.blinkCaret=闪烁
+options.textarea.blockCaret=块
+options.textarea.thickCaret=粗
+options.textarea.selection=单项选择:
+options.textarea.multipleSelection=多重选择:
+options.textarea.selectionFg=选择前景色:
+options.textarea.lineHighlight=高亮当前行
+options.textarea.structureHighlight=高亮匹配元素:
+options.textarea.eolMarkers=行标记结束:
+options.textarea.wrapGuide=换行指南:
+options.textarea.electricBorders=电动(自动滚动)边界
+options.textarea.stdNextPrevWord=跳至下一个/前一个单词命令,删除空白符
+options.textarea.antiAlias=消除锯齿平滑文本
+options.textarea.antiAlias.tooltip=在某些系统上减慢显示
+options.textarea.fracFontMetrics=小数字体度量
+options.textarea.fracFontMetrics.tooltip=不推荐使用亚像素抗锯齿
+options.textarea.stripTrailingEOL=隐藏最终的行(如果有的话)
+options.textarea.completeFromAllBuffers=所有打开内容的完整单词(默认是 \
+    在当前可见内容中限制搜索)
+options.textarea.lineSpacing.label=	额外的垂直行间距(以像素为单位):
+#}}}
+
+#{{{ Tool Bar pane
+options.toolbar.label=工具栏
+options.toolbar.showToolbar=显示工具栏
+options.toolbar.caption=工具栏显示的按钮:
+options.toolbar.add=添加...
+options.toolbar.edit=编辑...
+options.toolbar.remove=删除
+options.toolbar.moveUp=向上移动
+options.toolbar.moveDown=向下移动
+options.toolbar.reset=重置到默认
+options.toolbar.edit.title=编辑工具栏条目
+options.toolbar.edit.caption=类型:
+options.toolbar.edit.separator=分隔符
+options.toolbar.edit.action=命令或宏:
+options.toolbar.edit.builtin=使用内置的图标:
+options.toolbar.edit.file=从文件加载图标:
+options.toolbar.edit.choose=选择
+options.toolbar.edit.no-icon=没有选择图标
+
+options.toolbar.reset.dialog.title=重置为默认值
+options.toolbar.reset.dialog.message=你确定要重置工具栏到安装默认?
+#}}}
+
+#{{{ View pane
+options.view.label=视图
+options.view.viewLayout=查看布局
+options.view.floatableToolbars=流通工具栏
+options.view.alternateDockingLayout=备用停靠窗口位置
+options.view.alternateToolBarLayout=备用工具栏的位置
+options.view.abbreviatePaths=可能时,使用环境变量缩写路径
+options.view.showFullPath=在标题栏中显示完整路径缓冲区
+options.view.showSearchbar=总是显示搜索栏
+options.view.beepOnSearchAutoWrap=搜索自动换行时蜂鸣
+options.view.showBufferSwitcher=显示内容切换
+options.view.bufferSwitcherMaxRowsCount=可见行内容切换:
+options.view.sortBuffers=排序内容集
+options.view.sortByName=按文件名排序内容集, 而不是路径名
+options.view.fullScreenIncludesMenu=在全屏模式下显示菜单栏
+options.view.fullScreenIncludesToolbar=在全屏模式下显示工具栏
+options.view.fullScreenIncludesStatus=在全屏模式下显示状态栏
+options.bufferset.scope=内容范围:
+#}}}
+
+
+
+#{{{ File System Browser panes
+options.browser.label=文件系统浏览器
+
+options.browser.colors.label=颜色
+options.browser.colors.glob=全局文件名
+options.browser.colors.color=颜色
+options.browser.colors.add=添加
+options.browser.colors.remove=删除
+
+options.browser.general.label=普通
+options.browser.general.defaultPath=默认路径:
+options.browser.general.defaultPath.favorites=喜欢
+options.browser.general.defaultPath.home=主目录
+options.browser.general.defaultPath.last=最近访问目录
+options.browser.general.defaultPath.buffer=当前内容父目录
+options.browser.general.defaultPath.working=jEdit进程的工作目录
+options.browser.general.showMenubar=显示菜单栏
+options.browser.general.showToolbar=显示工具栏
+options.browser.general.showIcons=显示图标
+options.browser.general.showHiddenFiles=显示隐藏文件
+options.browser.general.sortIgnoreCase=排序时忽略大小写
+options.browser.general.sortMixFilesAndDirs=混合文件和目录
+options.browser.general.doubleClickClose=Double-点击打开的文件关闭
+options.browser.general.currentBufferFilter=文件对话框中筛选\
+当前缓冲区扩展
+options.browser.general.useDefaultIcons=使用默认图标
+#}}}
+
+#{{{ Browser Context Menu
+options.browser.custom.context.label=右键菜单
+options.browser.custom.context.caption=自定义浏览器中的右键菜单项目:
+#}}}
+
+#{{{ Font selector
+font-selector.title=字体选择
+font-selector.family=字体集合:
+font-selector.size=字体大小:
+font-selector.style=字体样式:
+font-selector.plain=平白
+font-selector.bold=加粗
+font-selector.italic=斜体
+font-selector.bolditalic=加粗倾斜
+font-selector.preview=预览
+font-selector.long-text=The quick brown fox jumps over the lazy dog.
+#}}}
+
+#{{{ Color chooser, used by options.syntaxs
+colorChooser.title=选择颜色
+#}}}
+
+#{{{ Style editor, used by options.syntaxs
+style-editor.title=样式编辑器
+style-editor.tokenType=语汇基元类型:
+style-editor.italics=斜体
+style-editor.bold=加粗
+style-editor.fgColor=文本颜色:
+style-editor.bgColor=背景颜色:
+#}}}
+
+#}}}
+
+#{{{ Plugin options dialog
+plugin-options.title=选项
+options.plugins.label=插件
+options.no-plugins.label=没有插件选项
+#}}}
+
+#{{{ Help viewer
+helpviewer.title=jEdit帮助
+helpviewer.loading=加载...
+helpviewer.back.label=返回
+helpviewer.forward.label=向前
+
+helpviewer.toc.loading=加载...
+helpviewer.toc.label=目录
+helpviewer.toc.welcome=欢迎来到 jEdit
+helpviewer.toc.readme=常规信息
+helpviewer.toc.changes=详细更改日志
+helpviewer.toc.todo=待办事项清单和已知错误
+helpviewer.toc.copying=GNU General Public License
+helpviewer.toc.copying-doc=GNU Free Documentation License
+helpviewer.toc.copying-apache=Apache License
+helpviewer.toc.copying-plugins=Plugin Licensing Amendment
+helpviewer.toc.plugins=插件
+helpviewer.toc.online-apidocs=jEdit的API参考(在线)
+helpviewer.search.label=搜索
+helpviewer.search.caption=搜索:
+helpviewer.searching=搜索中...
+helpviewer.no-results=没有结果
+#}}}
+
+#{{{ Tip of the day window
+tip.title=每日提示
+tip.caption=你知道吗...
+tip.show-next-time=启动时显示提示
+tip.next-tip=下一个提示
+
+tip.not-found=文件/提示 目录没有找到
+#}}}
+
+#{{{ Activity log
+log-viewer.title=活动日志
+log-viewer.caption=全文日志存储在 {0}.
+log-viewer.copy=复制
+log-viewer.tail.label=文档结尾
+#}}}
+
+#{{{ Marker Viewer
+view-markers.label=查看标记(Vie$w Markers)
+view-markers.title=标记
+#}}}
+
+#{{{ I/O progress monitor
+io-progress-monitor.title=I/O 进程监视器
+io-progress-monitor.caption={0} 挂起的请求.
+io-progress-monitor.idle=线程空闲
+io-progress-monitor.abort=退出
+
+#{{{ I/O abort dialog box
+abort.title=退出 I/O
+abort.message=你确定要中止当前正在执行的\n\
+输入/输出请求?如果中止保存文件,这可能\n\
+导致数据丢失。
+#}}}
+
+#}}}
+
+#{{{ Task  monitor
+task-monitor.title=任务监视器
+#}}}
+
+#{{{ VFS browser
+vfs.browser.title=文件浏览器
+vfs.browser.longtitle=文件系统浏览器
+vfs.browser.title.open=文件浏览器 - 打开
+vfs.browser.title.save=文件浏览器 - 保存
+vfs.browser.title.dialog=文件浏览器 - 打开
+vfs.browser.path=路径:
+vfs.browser.path.mnemonic=p
+vfs.browser.filter=过滤器:
+vfs.browser.tree.loading=加载...
+
+vfs.browser.name=名称
+vfs.browser.type=类型
+vfs.browser.type.file=文件
+vfs.browser.type.directory=目录
+vfs.browser.type.filesystem=文件系统
+vfs.browser.status=状态
+vfs.browser.status.no=没有权限
+vfs.browser.status.ro=只读
+vfs.browser.status.append=仅追加
+vfs.browser.status.rw=读/写
+vfs.browser.size=大小
+vfs.browser.modified=最后编辑
+
+vfs.browser.file_filter.glob=全局文件过滤
+vfs.browser.file_filter.dir_only=仅目录
+
+#{{{ Actions
+vfs.browser.browse-window.label=在新窗口中浏览
+vfs.browser.browse.label=浏览
+vfs.browser.close.label=关闭
+vfs.browser.copy-path.label=复制
+vfs.browser.delete.label=删除...
+vfs.browser.home.label=主目录
+vfs.browser.properties.label=属性
+vfs.browser.properties.title=文件/目录 属性
+vfs.browser.insert.label=插入
+vfs.browser.new-directory.label=新建目录...
+vfs.browser.new-file.label=新建文件
+vfs.browser.open.label=打开
+vfs.browser.open-desktop.label=在桌面打开(Open in $Desktop)
+vfs.browser.other-encoding-2.label=其它 ({0})...
+vfs.browser.other-encoding.label=其它...
+vfs.browser.reload.label=重新加载目录
+vfs.browser.rename.label=重命名...
+vfs.browser.roots.label=根目录
+vfs.browser.search-directory.label=在目录中搜索...
+vfs.browser.show-hidden-files.label=显示隐藏文件
+vfs.browser.synchronize.label=当前内容目录
+vfs.browser.up.label=父目录
+vfs.browser.paste.label=粘贴
+vfs.browser.previous.label=前一个目录
+vfs.browser.next.label=下一个目录
+#}}}
+
+#{{{ Tool bar
+
+#}}}
+
+#{{{ Commands menu
+vfs.browser.commands.label=指令($Commands)
+vfs.browser.commands.encoding.label=编码
+vfs.browser.commands.encoding.auto-detect=自动检测
+
+vfs.browser.open-in.label=打开在
+vfs.browser.open-view.label=新建视图
+vfs.browser.open-plain-view.label=新建空白视图
+vfs.browser.open-split.label=新建拆分
+#}}}
+
+#{{{ Plugins menu
+vfs.browser.plugins.label=插件($Plugins)
+vfs.browser.plugins.plugin-manager.label=插件管理器...
+vfs.browser.plugins.plugin-options.label=插件选项...
+vfs.browser.plugins.no-plugins.label=没有插件
+#}}}
+
+#{{{ Favorites menu
+vfs.browser.favorites.label=喜好(Fa$vorites)
+vfs.browser.favorites.add-to-favorites.label=添加到喜好
+vfs.browser.favorites.edit-favorites.label=编辑喜好
+vfs.browser.favorites.no-favorites.label=没有喜好
+#}}}
+
+vfs.browser.dialog.open=打开
+vfs.browser.dialog.save=保存
+vfs.browser.dialog.choose-dir=选择
+vfs.browser.dialog.filename=文件名:
+vfs.browser.dialog.filename.mnemonic=f
+
+#{{{ Dialogs
+vfs.browser.bad-filter.title=无效过滤器
+vfs.browser.bad-filter.message=过滤器 {0} 无效 ({1})
+
+vfs.browser.recurse-favorites.title=不能添加喜好给自己
+vfs.browser.recurse-favorites.message=喜好列表无法添加给自己.
+
+vfs.browser.delete-confirm.title=删除文件确认
+vfs.browser.delete-confirm.message=你确定要删除以下 {1}?
+
+vfs.browser.delete-favorites.title=从喜好删除
+vfs.browser.delete-favorites.message=你确定要从喜好\
+	删除以下文件?
+
+vfs.browser.rename.title=重命名文件
+vfs.browser.rename.message=为 {0}键入一个新名称:
+
+vfs.browser.mkdir.title=新目录
+vfs.browser.mkdir.message=新目录名称(或路径):
+#}}}
+
+#}}}
+
+#{{{ I/O status messages
+vfs.status.load=正在加载 {0}
+vfs.status.load-markers=正在加载 {0}的标记
+vfs.status.save=正在保存 {0}
+vfs.status.save-markers=正在保存 {0}的标记
+vfs.status.autosave=正在自动保存 {0}
+vfs.status.listing-directory=正在列出 {0}
+vfs.status.deleting=正在删除 {0}
+vfs.status.renaming=正在重命名 {0} 到 {1}
+#}}}
+
+#{{{ Plugin manager
+
+plugin-manager.title=插件管理器
+
+plugin-manager.hide-libraries=隐藏库
+
+plugin-manager.mgr-options=下载选项...
+plugin-manager.plugin-options=插件选项...
+plugin-manager.done=关闭
+
+plugin-manager.remove-confirm.title=移除插件
+plugin-manager.remove-confirm.message=你确定要删除以下\
+	插件吗?
+
+plugin-manager.dependency.title=插件依赖项
+plugin-manager.dependency.message=以下插件需要{0}.\n\
+	取消 {0} 将要使下列插件取消:
+
+plugin-manager.remove-dependencies.title=插件依赖项
+plugin-manager.remove-dependencies.message=删除插件的需要以下插件.\n\
+	删除它们也将取消下面的插件:
+
+plugin-manager.cleanup.label=清除
+plugin-manager.cleanup.title=清除插件数据
+plugin-manager.cleanup.message=清除以下插件的数据:
+
+plugin-manager.noOrphan.label=查找孤立的
+plugin-manager.noOrphan.title=无孤立的jar文件发现
+plugin-manager.noOrphan.message=jEdit的安装有没有孤立的jar文件
+
+plugin-manager.findOrphan.label=查找孤立的
+plugin-manager.findOrphan.title=发现孤立的 jars文件
+plugin-manager.findOrphan.message=下列jar文件不属于任何插件\n \
+删除它们吗?\n(警告,他们可能在一下插件中动态声明\n\
+  如JDBC驱动插件):
+
+install-plugins.depend.title=需要依赖项
+install-plugins.depend.message=一个或更多的插件安装\n\
+需要额外的插件。如果你继续他们将被自动\n \
+安装。
+
+plugin-manager.status.loaded=已加载
+plugin-manager.status.disabled=不支持
+plugin-manager.status.not-loaded=没有加载
+plugin-manager.status.error=错误
+
+plugin-manager.list-download-connect=连接到 plugins.jedit.org
+plugin-manager.list-download=从m plugins.jedit.org下载插件列表
+plugin-manager.list-download.mirror-autoselect-error.title=镜像选择错误
+plugin-manager.list-download.mirror-autoselect-error.message=镜像自动选择错误:\n\
+	{0}\n\
+	指定一个镜像可能有效.
+plugin-manager.list-download.need-password.title=HTTP 代理需要密码
+plugin-manager.list-download.need-password.message=HTTP 代理需要密码.\n\
+	请在“下载选项”配置有效的用户名/密码.
+plugin-manager.list-download.disconnected.title=下载插件列表错误
+plugin-manager.list-download.disconnected.message=插件列表无法下载:\n\
+服务器 {0} 无效. 请检查你的互联网连接...
+plugin-manager.list-download.generic-error.title=下载插件列表错误
+plugin-manager.list-download.generic-error.message=下载插件列表错误:\n\
+错误是 {0} - {1}
+plugin-manager.filterField=只显示其名称中包含这段文字的插件
+
+#{{{ Plugin management
+manage-plugins.title=管理
+
+manage-plugins.info.name=名称
+manage-plugins.info.version=版本
+manage-plugins.info.status=状态
+manage-plugins.info.data=数据
+
+manage-plugins.data-size.unknown=<unknown>
+
+manage-plugins.remove=移除...
+manage-plugins.help=帮助...
+plugin-load-error.message=无法加载插件
+plugin-load-error.title=插件加载错误
+#}}}
+
+#{{{ Plugin installation
+install-plugins.title=安装
+
+install-plugins.info.name=名称
+install-plugins.info.size=大小
+install-plugins.info.releaseDate=发布日期
+install-plugins.info.version=版本
+install-plugins.info.category类别
+
+install-plugins.totalSize={0} 个插件), 总大小: {1}
+install-plugins.select-all=全选
+install-plugins.install=安装
+install-plugins.show-updates=显示更新
+
+install-plugins.info=<b>作者</b>: {0}\n\
+	<b>发布了</b>: {1}\n\
+	{2}
+
+update-plugins.title=更新
+
+plugin-manager.progress=正在从 {1}下载 {0} 
+plugin-manager.progress.title=正在安装插件
+plugin-manager.progress.stop=停止
+#}}}
+
+#{{{ Plugin remove error
+plugin-manager.remove-failed.title=移除失败项
+plugin-manager.remove-failed.message=插件 {0}\n\
+	无法被移除.
+#}}}
+
+#}}}
+
+#{{{ File Properties Dialog
+fileprop.name=名称
+fileprop.path=路径
+fileprop.lastmod=最后编辑
+fileprop.size=大小
+fileprop.properties=特性
+fileprop.readable=可读
+fileprop.writeable=可写
+fileprop.attribute=属性
+fileprop.okBtn=确定
+fileprop.cancelBtn=取消
+fileprop.selectedFiles=已选文件
+fileprop.selectedDirectories=已选目录
+#}}}
+
+#{{{ Activity log viewer
+log-viewer.dialog.title=活动日志设置
+log-viewer.settings.label=设置
+log-viewer.message.label=消息显示:
+log-viewer.message.debug.label=调试
+log-viewer.message.message.label=消息
+log-viewer.message.notice.label=注意
+log-viewer.message.warning.label=警告
+log-viewer.message.error.label=错误
+# This one should be actually placed in Debugging options, but
+# we don't have such a pane yet
+debug.beepOnOutput.label=输出时蜂鸣
+#}}}
+
+logs-remove-all-errors.label=删除所有错误
+
+taskmanager.remainingtasks.label={0} 个剩余任务
+
+#{{{ Statusbar Widgets
+# the widgets should have a label and a sample.
+# the label is displayed when choosing the list of widgets
+# the sample is an example of what the widget will show, for the
+# preview in the options
+statusbar.mode.label=内容编辑模式 (ex:java)
+statusbar.mode.sample=java
+statusbar.fold.label=内容折叠处理程序 (ex:explicit)
+statusbar.fold.sample=显式
+statusbar.encoding.label=内容编码 (ex:UTF-8)
+statusbar.encoding.sample=UTF-8
+statusbar.wrap.label=内容换行模式 (ex:N)
+statusbar.wrap.sample=N
+statusbar.indent.label=自动缩进 (ex:F)
+statusbar.indent.sample=F
+statusbar.multiSelect.label=内容多重选择模式 (ex:m)
+statusbar.multiSelect.sample=m
+statusbar.rectSelect.label=内容矩形选择模式 (ex:r)
+statusbar.rectSelect.sample=r
+statusbar.overwrite.label=Buffer overwrite (ex:o)
+statusbar.overwrite.sample=o
+statusbar.lineSep.label=内容行分割器 (ex:U)
+statusbar.lineSep.sample=U
+statusbar.memory-status.label=内存状态 (ex:9/24Mb)
+statusbar.memory-status.sample=9/24Mb
+statusbar.clock.label=时钟 (ex:16:45)
+statusbar.clock.sample=16:45
+statusbar.buffersets.label=内容集范围 (ex:G)
+statusbar.buffersets.sample=G
+statusbar.selection-length.label=选择范围长度 (ex:192)
+statusbar.selection-length.sample=192
+statusbar.last-modified.label=磁盘上的最后修改日期 (ex:12/03/11 16:43)
+statusbar.last-modified.sample=12/03/11 16:43
+statusbar.task-monitor.label=任务监视器 (ex: 7 task(s))
+statusbar.task-monitor.tooltip=点击查看正在运行的可停靠任务
+statusbar.task-monitor.sample=7 个任务
+statusbar.task-monitor.template={0} 个任务
+#}}}
+
+killring.load-memoryerror.message=<html>无法加载之前删除的文本. 请增加内存堆空间.<br>\
+  点击 <b>开始</b> 以启动jEdit,或者 <br><b>结束</b> 已结束并且改变你的设置. <br>你并且可以 <b>删除这些历史文件</b> 再启动 jEdit</html>
+killring.load-memoryerror.title=内存错误
+killring.start=开始
+killring.stop=停止
+killring.delete=删除killring,并开始
+
+#}}}
+
+#{{{ Macros
+
+#{{{ Properties used by macros
+
+#{{{ common
+macro.rs.general.ErrorNotEditableDialog.title=写权限
+macro.rs.general.ErrorNotEditableDialog.message=内容无法编辑!
+#}}}
+
+#{{{ Clipboard
+
+#{{{ Copy Lines Containing
+macro.rs.CopyLinesContaining.CopyLinesContaining.label=复制包含以下内容的行:
+macro.rs.CopyLinesContaining.LinesCopied.message=行已复制
+#}}}
+
+#{{{ Cut Lines Containing
+macro.rs.CutLinesContaining.CutLinesContaining.label=剪切包含以下内容的行:
+macro.rs.CutLinesContaining.LinesCut.message=行以剪切
+#}}}
+
+#}}}
+
+#{{{ Editing
+
+#{{{ Go to column
+macro.rs.GoToColumn.ColumnBefore.label=列 (在 1 和
+macro.rs.GoToColumn.ColumnAfter.label=):
+#}}}
+
+#{{{ Key Words to Uppercase
+macro.rs.KeywordsToUpperCase.ConvertedKeywords.message=转换关键词为大写
+#}}}
+
+#{{{ Mode Switcher
+macro.rs.BufferModeSwitcher.MainDialog.title=内容模式开关
+macro.rs.BufferModeSwitcher.EnterBufferMode.label=键入内容模式:
+macro.rs.BufferModeSwitcher.ChangingBufferMode.label=正在改变内容模式
+macro.rs.BufferModeSwitcher.To.label=到
+macro.rs.BufferModeSwitcher.Mode.label=模式
+macro.rs.BufferModeSwitcher.NotFound.label=未发现
+#}}}
+
+#{{{ Moves Lines Down - Move Lines Up
+macro.rs.MoveLines.NoMultipleSelection.error=行移动无法在多重选择下执行.
+#}}}
+
+#}}}
+
+#{{{ Files
+
+#{{{ Browse Directory
+macro.rs.BrowseDirectory.DirectoryBrowse.label=要流量的目录:
+#}}}
+
+#{{{ Buffer Switcher
+macro.rs.BufferSwitcher.OpenBuffers.label=打开内容
+macro.rs.BufferSwitcher.QuickHelp.label=[ENTER] 转换到; [SPACE] 转换到, 保留对话框; [DEL] 关闭内容
+macro.rs.BufferSwitcher.Help1.label=内容切换宏帮助:
+macro.rs.BufferSwitcher.Help2.label=DELETE 关闭选择内容.
+macro.rs.BufferSwitcher.Help3.label=ENTER 切换到选定的内容,关闭对话框.
+macro.rs.BufferSwitcher.Help4.label=ESCAPE 关闭对话框.
+macro.rs.BufferSwitcher.Help5.label=SPACE 切换到选定的内容,不会关闭对话.
+macro.rs.BufferSwitcher.Help6.label=注意: 这个对话框只显示一次
+#}}}
+
+#{{{ Delete Current
+macro.rs.DeleteCurrent.NotOnDisk.error=内容不存在于磁盘上.
+macro.rs.DeleteCurrent.DeleteNotSupport.error=不支持删除.
+macro.rs.DeleteCurrent.Deleted.message=已删除:
+#}}}
+
+#{{{ Glob Close
+macro.rs.GlobClose.GlobPattern.label=全局模式 (e.g. *.txt or /usr/include/*):
+macro.rs.GlobClose.ErrorGlobPattern.error=全局模式错误:
+#}}}
+
+#{{{ Next Dirty Buffer
+macro.rs.NextDirtyBuffer.NoOtherBufferDirty.message=没有其它内容混乱
+macro.rs.NextDirtyBuffer.NoBufferDirty.message=无混乱内容
+#}}}
+
+#{{{ open Path
+macro.rs.OpenPath.PathName.label=路径名:
+#}}}
+
+#{{{Toggle ReadOnly
+macro.rs.ToggleReadOnly.OnlyLocalFiles.error=这个宏仅适用于本地文件.
+macro.rs.ToggleReadOnly.OnlyWindowsUnixMacos.error=这个宏仅适用于 Windows, Unix, 以及 MacOS X.
+#}}}
+
+#}}}
+
+#{{{ Interface
+
+#{{{ Decrease Font Size - Increase Font Size
+macro.rs.ChangeFontSize.FontSize.message=当前字体大小:
+#}}}
+
+#}}}
+
+#{{{ Java
+
+#{{{ Create Constructor
+macro.rs.CreateConstructor.UnevenNumber.message=奇数类型名称和变量.
+#}}}
+
+#{{{ Get Package Name
+macro.rs.GetPackageName.NotWorking1.error=这个宏在Java编译时不工作
+macro.rs.GetPackageName.NotWorking2.error=使用'-jar' 命令行选项加载jEdit.
+macro.rs.GetPackageName.NotFind.error=找不到包名.
+#}}}
+
+#{{{ Java File Save
+macro.rs.JavaFileSave.InfiniteLoop.error=无限循环:
+#}}}
+
+#{{{Make Get and Set Methods
+macro.rs.MakeGetAndSetMethods.GenerateCode.label=生成代码
+macro.rs.MakeGetAndSetMethods.CreateGetMethods.label=创建Get方法
+macro.rs.MakeGetAndSetMethods.CreateSetMethods.label=创建Set方法
+macro.rs.MakeGetAndSetMethods.CreateGetandSetMethods.label=创建Get以及Set方法
+#}}}
+
+#}}}
+
+#{{{ Misc
+
+#{{{ Buffer to HyperSearch Results - HyperSearch Results to Buffer
+macro.rs.HyperSearchResults.WindowNotOpen.error='超级搜索结果“窗口未打开.
+macro.rs.HyperSearchResults.NotMatch.error=没有匹配的超级搜索.
+#}}}
+
+#{{{ Debug BufferSets
+macro.rs.DebugBuffersets.BuffersetDebugging.label=内容集调试中
+macro.rs.DebugBuffersets.BufferCount.label=内容数:
+macro.rs.DebugBuffersets.BufferList.label=内容列表
+macro.rs.DebugBuffersets.EndBufferList.label=内容列表结束
+macro.rs.DebugBuffersets.EditpaneList.label=编辑面板列表
+macro.rs.DebugBuffersets.EndEditpaneList.label=编辑面板列表结束
+#}}}
+
+#{{{ Display Abbreviations
+macro.rs.DisplayAbbreviations.Abbreviation.label=缩写
+macro.rs.DisplayAbbreviations.Expansion.label=扩展
+macro.rs.DisplayAbbreviations.Close.label=关闭
+macro.rs.DisplayAbbreviations.WriteSet.label=写设置
+macro.rs.DisplayAbbreviations.WriteAll.label=全写
+macro.rs.DisplayAbbreviations.AbbreviationList.label=缩写词列表
+macro.rs.DisplayAbbreviations.CallingWTTNB.label=调用将表单写入新内容
+macro.rs.DisplayAbbreviations.SizeVector.label=向量大小:
+macro.rs.DisplayAbbreviations.jEditAbbreviationTable.label=jEdit 缩写表
+macro.rs.DisplayAbbreviations.AbbreviationSet.label=缩写集:
+macro.rs.DisplayAbbreviations.AbbreviationExpansion.label=缩写扩展
+macro.rs.DisplayAbbreviations.NoAbbreviations.label=<< 没有缩略语 >>
+#}}}
+
+#{{{ Display Actions
+macro.rs.DisplayActions.jEditActionBar1.label=jEdit的动作栏可以通过“工具”菜单中打开而且通常
+macro.rs.DisplayActions.jEditActionBar2.label=分配给 C+ENTER 的键盘快捷键.
+macro.rs.DisplayActions.NoLabel.label=<没有标签>
+#}}}
+
+#{{{ Display Character Code
+macro.rs.DisplayCharacterCode.CharacterAtCaret.label=插入符号字符:
+#}}}
+
+#{{{ Display Shorcuts
+macro.rs.DisplayShortcuts.jEditShortcutTable.label=jEdit的键盘快捷键表
+macro.rs.DisplayShortcuts.Name.label=名称
+macro.rs.DisplayShortcuts.Shortcut1.label=快捷键 - 1
+macro.rs.DisplayShortcuts.Shortcut2.label=快捷键 - 2
+macro.rs.DisplayShortcuts.Close.label=关闭
+macro.rs.DisplayShortcuts.WriteToBuffer.label=写入到内容
+macro.rs.DisplayShortcuts.ShortcutList.label=键盘快捷键列表
+macro.rs.DisplayShortcuts.Center.label=中心
+macro.rs.DisplayShortcuts.South.label=南部
+#}}}
+
+#{{{ Hex Convert
+macro.rs.HexConvert.Before.label=之前:
+macro.rs.HexConvert.After.label=之后:
+macro.rs.HexConvert.NotValidHex.label=不是有效的十六进制字符串.
+macro.rs.HexConvert.ByteToString.label=字节转化为字符串:
+#}}}
+
+#{{{ Make Bug Report
+macro.rs.MakeBugReport.OpeningActivityLog.error=打开活动日志错误.
+macro.rs.MakeBugReport.UsefulEntriesForReport.label=活动日志条目在bug报告里可能是有用的:\n\n.
+macro.rs.MakeBugReport.MessagejEdit.label=[message] jEdit:
+macro.rs.MakeBugReport.NoticejEdit.label=[notice] jEdit:
+macro.rs.MakeBugReport.NoticeJarClassLoader.label=[notice] JARClassLoader:
+macro.rs.MakeBugReport.MessagejEditStartupComplete.label=[message] jEdit: 完成启动
+macro.rs.MakeBugReport.Error.label=[error]
+macro.rs.MakeBugReport.ReadingActivityLog.error=阅读活动日志错误
+#}}}
+
+#{{{ Run Script
+macro.rs.RunScript.SpecifyParametersForRunning.label=指定运行脚本下的参数
+macro.rs.RunScript.ScriptExecutionCancelled.message=脚本执行被取消.
+macro.rs.RunScript.FileNotScript.error=当前文件可能不是是一个脚本.
+#}}}
+
+#{{{ Show Threads
+macro.rs.ShowThreads.Daemon.label=daemon
+macro.rs.ShowThreads.Priority.label=prio
+macro.rs.ShowThreads.NotStarted.label=未启动
+macro.rs.ShowThreads.Interrupted.label=中断
+macro.rs.ShowThreads.CloseUpdate.label=[Esc] 关闭      [U] 更新
+macro.rs.ShowThreads.CurrentThreads.label=当前进程
+#}}}
+
+#}}}
+
+#{{{ Properties
+
+#{{{ Insert Buffer Properties
+macro.rs.InsertBufferProperties.InsertLocalProperties.label=插入缓冲区本地属性
+macro.rs.InsertBufferProperties.Properties.label=特性:
+macro.rs.InsertBufferProperties.Insert.label=插入
+macro.rs.InsertBufferProperties.MustBeIn10Lines.message=注:缓冲区局部属性必须在缓冲区的第一个或最后10行以被jEdit认可.
+#}}}
+
+#{{{ Look and Feel Properties
+macro.rs.LookAndFeelProperties.Listing.label=--列出的外观和感觉的属性名称--
+#}}}
+
+#{{{ System Properties
+macro.rs.SystemProperties.SystemProperties.label=系统属性
+#}}}
+
+#}}}
+
+#{{{ Text
+
+#{{{ Add Prefix And Suffix
+macro.rs.AddPrefixAndSuffix.MainDialog.title=添加前缀和后缀到选择行
+macro.rs.AddPrefixAndSuffix.PrefixToAdd.label=要添加的前缀:
+macro.rs.AddPrefixAndSuffix.SuffixToAdd.label=要添加的后缀:
+#}}}
+
+#{{{ Color Picker
+macro.rs.ColorPicker.ColorPicker.label=颜色选择器
+#}}}
+
+#{{{ Insert Date
+macro.rs.InsertDate.InternetTime.label=互联网时间
+#}}}
+
+#{{{ Insert Tag
+macro.rs.InsertTag.EnterNameTag.label=输入标签名称:
+#}}}
+
+#{{{ Line_Filter
+macro.rs.LineFilter.MainDialog.title=行过滤器
+macro.rs.LineFilter.ignoreCaseCheckBox.label=忽略大小写
+macro.rs.LineFilter.regexpPanelBorder.title=模式比较(正则表达式)
+macro.rs.LineFilter.processModeRadioButtonMatching.label=正在匹配
+macro.rs.LineFilter.processModeRadioButtonNotMatching.label=没有匹配
+macro.rs.LineFilter.processModeOptionPanelBorder.title=行
+macro.rs.LineFilter.actionModeRadioButtonWrite.label=写到新内容
+macro.rs.LineFilter.actionModeRadioButtonDelete.label=删除
+macro.rs.LineFilter.actionModeOptionPanelBorder.title=动作
+
+macro.rs.LineFilter.DeleteActionDisabled.message=删除不可用
+macro.rs.LineFilter.MultipleSelection.message=不支持多重选择
+macro.rs.LineFilter.BlockSelection.message=不支持矩形选择
+
+macro.rs.LineFilter.SummaryDeleted.label=行已删除!
+macro.rs.LineFilter.SummaryWritten.label=行写入新内容.
+
+macro.rs.LineFilter.ErrorRegexpDialog.title=无效的正则表达式
+macro.rs.LineFilter.ErrorRegexpDialog.message=正则表达式无效!
+#}}}
+
+#{{{ Next Char
+macro.rs.InsertTag.EnterCharacter.label=输入一个字符
+#}}}
+
+#{{{ Reverse Lines
+macro.rs.ReverseLines.NotWorkingRectangularSelection.error=对不起,这个宏在矩形选择下不起作用.
+#}}}
+
+#{{{ Single Space Buffer
+macro.rs.SingleSpaceBuffer.NotDoubleSpaced.message=似乎没有双倍行距:
+macro.rs.SingleSpaceBuffer.Line.message=行
+macro.rs.SingleSpaceBuffer.NotBlank.message=不是空白.
+#}}}
+
+#}}}
+
+#}}}
+
+#{{{ Macro Names for Macros Menu (only original macros in original folders!)
+
+#{{{ C
+macros.folder.C.label=C
+
+C/Include_Guard.label=Include Guard
+C/Toggle_Header_Source.label=切换 Header Source
+#}}}
+
+#{{{ Clipboard
+macros.folder.Clipboard.label=粘贴板
+
+Clipboard/Copy_Lines.label=复制行
+Clipboard/Copy_Lines_Containing.label=复制行包含
+Clipboard/Copy_Visible_Lines.label=复制可见行
+Clipboard/Cut_Lines.label=剪切行
+Clipboard/Cut_Lines_Containing.label=剪切行包含
+Clipboard/Paste_Indent.label=复制缩进
+#}}}
+
+#{{{ Editing
+macros.folder.Editing.label=正在编辑
+
+Editing/Duplicate_Lines_Above.label=复制以上行
+Editing/Duplicate_Lines_Below.label=复制以下行
+Editing/Go_to_Column.label=跳至列
+Editing/Greedy_Backspace.label=贪婪退格键
+Editing/Greedy_Delete.label=贪婪删除
+Editing/Greedy_Left.label=贪婪左键
+Editing/Greedy_Right.label=贪婪右键
+Editing/Keywords_to_Upper_Case.label=关键字转化为大写
+Editing/Mode_Switcher.label=模式开关
+Editing/Move_Lines_Down.label=行下移
+Editing/Move_Lines_Up.label=行上移
+Editing/Open_Line_Above.label=打开上行
+Editing/Open_Line_Below.label=打开下行
+Editing/Toggle_Fold.label=切换折叠
+#}}}
+
+#{{{ Emacs
+macros.folder.Emacs.label=Emacs
+Emacs/Emacs_Align_Decls.label=Emacs 声明对齐
+Emacs/Emacs_Backward_Sentence.label=Emacs 向后句
+Emacs/Emacs_Capitalize_Word.label=Emacs 大写单词
+Emacs/Emacs_Center_Line.label=Emacs 中心线
+Emacs/Emacs_Ctrl-K.label=Emacs Ctrl-K
+Emacs/Emacs_Downcase_Word.label=Emacs 小写单词
+Emacs/Emacs_Exchange_Point_and_Mark.label=Emacs 交换点和标记
+Emacs/Emacs_Fixup_Whitespace.label=Emacs 修正空白
+Emacs/Emacs_Forward_Sentence.label=Emacs 正向句
+Emacs/Emacs_Insert_File.label=Emacs 插入文件
+Emacs/Emacs_Kill_Line.label=Emacs 删除行
+Emacs/Emacs_Kill_Region.label=Emacs 删除区域
+Emacs/Emacs_Kill_Ring_Save.label=Emacs 删除 Ring 保存
+Emacs/Emacs_Kill_Sentence.label=Emacs 删除句
+Emacs/Emacs_Next_Line.label=Emacs 下一行
+Emacs/Emacs_Open_Line.label=Emacs 打开行
+Emacs/Emacs_Previous_Line.label=Emacs 前一行
+Emacs/Emacs_Set_Mark.label=Emacs 设置标记
+Emacs/Emacs_Set_Wrap=Emacs 设置自动换行
+Emacs/Emacs_Transpose_Chars.label=Emacs 转置字符
+Emacs/Emacs_Transpose_Lines.label=Emacs 转置行
+Emacs/Emacs_Upcase_Word.label=Emacs 单词大写
+#}}}
+
+#{{{ Files
+macros.folder.Files.label=文件
+
+Files/Browse_Buffer_Directory.label=浏览内容目录
+Files/Browse_Directory.label=浏览目录
+Files/Buffer_Switcher.label=内容开关
+Files/Close_All_Except_Active.label=关闭除活动区外所有内容
+Files/Copy_Name_to_Clipboard.label=复制内容到粘贴板
+Files/Copy_Path_to_Clipboard.label=复制路径到粘贴板
+Files/Delete_Current.label=删除当前
+Files/Duplicate_Buffer.label=复制内容
+Files/Glob_Close.label=全局关闭
+Files/Insert_Selection.label=插入选择
+Files/Next_Dirty_Buffer.label=下一个混乱内容
+Files/Open_Path.label=打开路径
+Files/Open_Selection.label=打开选择内容
+Files/Send_Buffer_To_Next_Split.label=内容移入下一个拆分
+Files/Toggle_ReadOnly.label=切换只读
+#}}}
+
+#{{{ Interface
+macros.folder.Interface.label=接口
+
+Interface/Decrease_Font_Size.label=减小字体
+Interface/Increase_Font_Size.label=增大字体
+Interface/Open_Context_Menu.label=打开右键菜单
+Interface/Reset_TextArea.label=复制文本区域
+Interface/Splitpane_Grow.label=拆分窗格增长
+Interface/Toggle_Bottom_Docking_Area.label=切换底部停靠区域
+Interface/Toggle_Left_Docking_Area.label=切换左停靠区
+Interface/Toggle_Right_Docking_Area.label=切换右停靠区
+Interface/Toggle_Top_Docking_Area.label=切换顶部停靠区
+#}}}
+
+#{{{ Java
+macros.folder.Java.label=Java
+
+Java/Create_Constructor.label=Create Constructor
+Java/Get_Class_Name.label=Get Class Name
+Java/Get_Package_Name.label=Get Package Name
+Java/Java_File_Save.label=Java File Save
+Java/Make_Get_and_Set_Methods.label=Make Get and Set Methods
+Java/Preview_JavaDoc_Of_Current_Buffer.label=Preview JavaDoc Of Current Buffer
+#}}}
+
+#{{{ Misc
+macros.folder.Misc.label=Misc
+
+Misc/Buffer_to_HyperSearch_Results.label=内容转化为超级搜索结果
+Misc/Debug_BufferSets.label=调试内容集
+Misc/Display_Abbreviations.label=显示缩写
+Misc/Display_Actions.label=显示动作
+Misc/Display_Character_Code.label=显示字符代码
+Misc/Display_Shortcuts.label=显示快捷键
+Misc/Evaluate_Buffer_in_BeanShell.label=在 BeanShell测试内容
+Misc/Hex_Convert.label=十六进制转换
+Misc/HyperSearch_Results_to_Buffer.label=超级搜索结果转换为内容
+Misc/Make_Bug_Report.label=错误报告
+Misc/Run_Script.label=运行脚本
+Misc/Show_Threads.label=显示线程
+#}}}
+
+#{{{ Properties
+macros.folder.Properties.label=特性
+
+Properties/Create_Plugin_Announcement.label=创建插件声明
+Properties/Insert_Buffer_Properties.label=插入内容属性
+Properties/jEdit_Properties.label=jEdit 特性
+Properties/Look_and_Feel_Properties.label=外观和感觉属性
+Properties/System_Properties.label=系统属性
+#}}}
+
+#{{{ Text
+macros.folder.Text.label=文本
+
+Text/Add_Prefix_and_Suffix.label=添加前缀和后缀
+Text/Color_Picker.label=颜色选择器
+Text/Compose_Tag.label=构图标签
+Text/Duplicate_Line.label=重复行
+Text/Insert_Date.label=插入时间
+Text/Insert_Tag.label=插入标签
+Text/Line_Filter.label=行过滤器
+Text/Next_Char.label=下一个字符
+Text/Reverse_Lines.label=行倒置
+Text/Single_Space_Buffer.label=单空间缓冲区
+#}}}
+
+#}}}
+
+#}}}
diff --git a/org/gjt/sp/jedit/datatransfer/JEditRichText.java b/org/jedit/migration/CheckFileStatus.java
similarity index 51%
copy from org/gjt/sp/jedit/datatransfer/JEditRichText.java
copy to org/jedit/migration/CheckFileStatus.java
index 739c839..0ac30fa 100644
--- a/org/gjt/sp/jedit/datatransfer/JEditRichText.java
+++ b/org/jedit/migration/CheckFileStatus.java
@@ -1,58 +1,37 @@
-/*
- * JEditRichText.java
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2010 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package org.gjt.sp.jedit.datatransfer;
-
-import org.gjt.sp.jedit.Mode;
-import org.gjt.sp.jedit.syntax.ModeProvider;
-
-/**
- * @author Matthieu Casanova
- * @since jEdit 4.4.x
- */
-public class JEditRichText
-{
-	private final String text;
-
-	private final String mode;
-
-	public JEditRichText(String text, String mode)
-	{
-		this.text = text;
-		this.mode = mode;
-	}
-
-	public String getText()
-	{
-		return text;
-	}
-
-	public Mode getMode()
-	{
-		return ModeProvider.instance.getMode(mode);
-	}
-
-	@Override
-	public String toString()
-	{
-		return text;
-	}
-}
+/* CheckFileStatus.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2012 Alan Ezust
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.jedit.migration;
+import org.gjt.sp.jedit.jEdit;
+import org.gjt.sp.jedit.options.GeneralOptionPane;
+
+
+//{{{ CheckFileStatus class
+/** Migration step for the 'checkFileStatus' property whose meaning changed slightly
+    in jEdit. Default value was before 0 and is now 1. */
+public class CheckFileStatus extends OneTimeMigrationService {
+	public CheckFileStatus() {
+		super("checkFileStatus");
+	}
+	public void migrate() {
+		if ((jEdit.getIntegerProperty("checkFileStatus", GeneralOptionPane.checkFileStatus_focus) == 0))
+			jEdit.setIntegerProperty("checkFileStatus", GeneralOptionPane.checkFileStatus_focus);
+	}
+}
diff --git a/org/jedit/migration/KeymapMigration.java b/org/jedit/migration/KeymapMigration.java
index c95b0d1..22ec83e 100644
--- a/org/jedit/migration/KeymapMigration.java
+++ b/org/jedit/migration/KeymapMigration.java
@@ -1,67 +1,67 @@
-/*
- * jEdit - Programmer's Text Editor
- * :tabSize=8:indentSize=8:noTabs=false:
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright © 2011 Matthieu Casanova
- *
- * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-package org.jedit.migration;
-
-import java.io.File;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.gjt.sp.jedit.jEdit;
-import org.jedit.core.MigrationService;
-import org.jedit.keymap.Keymap;
-import org.jedit.keymap.KeymapManager;
-
-/** Extracts, removes the shortcuts from jEdit 4.5 properties, and places them into the "imported" keymap. 
- * @author Matthieu Casanova
- */
-public class KeymapMigration implements MigrationService
-{
-	@Override
-	public void migrate()
-	{
-		String settingsDirectory = jEdit.getSettingsDirectory();
-		if (settingsDirectory == null)
-			return;
-		File keymapFolder = new File(settingsDirectory, "keymaps");
-		if (keymapFolder.exists())
-			return;
-
-		KeymapManager keymapManager = jEdit.getKeymapManager();
-		keymapManager.copyKeymap(KeymapManager.DEFAULT_KEYMAP_NAME, "imported");
-		Keymap imported = keymapManager.getKeymap("imported");
-		Properties properties = jEdit.getProperties();
-		Set<Map.Entry<Object,Object>> entries = properties.entrySet();
-		for (Map.Entry<Object, Object> entry:entries)
-		{
-		        String key = entry.getKey().toString();
-			if (key.endsWith(".shortcut") || key.endsWith(".shortcut2"))
-			{
-				imported.setShortcut(key, entry.getValue().toString());
-				jEdit.resetProperty(key);
-			}
-		}
-		imported.save();
-		jEdit.setProperty("keymap.current", "imported");
-		keymapManager.reload();
-	}
-}
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2011 Matthieu Casanova
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.jedit.migration;
+
+import java.io.File;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.gjt.sp.jedit.jEdit;
+import org.jedit.core.MigrationService;
+import org.jedit.keymap.Keymap;
+import org.jedit.keymap.KeymapManager;
+
+/** Extracts, removes the shortcuts from jEdit 4.5 properties, and places them into the "imported" keymap. 
+ * @author Matthieu Casanova
+ */
+public class KeymapMigration implements MigrationService
+{
+	@Override
+	public void migrate()
+	{
+		String settingsDirectory = jEdit.getSettingsDirectory();
+		if (settingsDirectory == null)
+			return;
+		File keymapFolder = new File(settingsDirectory, "keymaps");
+		if (keymapFolder.exists())
+			return;
+
+		KeymapManager keymapManager = jEdit.getKeymapManager();
+		keymapManager.copyKeymap(KeymapManager.DEFAULT_KEYMAP_NAME, "imported");
+		Keymap imported = keymapManager.getKeymap("imported");
+		Properties properties = jEdit.getProperties();
+		Set<Map.Entry<Object,Object>> entries = properties.entrySet();
+		for (Map.Entry<Object, Object> entry:entries)
+		{
+		        String key = entry.getKey().toString();
+			if (key.endsWith(".shortcut") || key.endsWith(".shortcut2"))
+			{
+				imported.setShortcut(key, entry.getValue().toString());
+				jEdit.resetProperty(key);
+			}
+		}
+		imported.save();
+		jEdit.setProperty("keymap.current", "imported");
+		keymapManager.reload();
+	}
+}
diff --git a/org/jedit/migration/OneTimeMigrationService.java b/org/jedit/migration/OneTimeMigrationService.java
new file mode 100644
index 0000000..849d843
--- /dev/null
+++ b/org/jedit/migration/OneTimeMigrationService.java
@@ -0,0 +1,83 @@
+/* OneTimeMigrationService.java
+ * :tabSize=4:indentSize=4:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2012 Alan Ezust
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+
+package org.jedit.migration;
+import org.gjt.sp.jedit.ServiceManager;
+import org.gjt.sp.jedit.jEdit;
+import org.gjt.sp.util.Log;
+import org.jedit.core.MigrationService;
+
+//{{{ OneTimeMigrationService class
+/** Base class from which one can more easily implement a migration step
+    that should be executed only once per installation. 
+    <p>
+    Concrete implementations of this class should register themselves in services.xml.
+    jEdit will call doMigration() on each object, which will skip the ones that
+    have been done before.
+    <p> 
+    The time that these services are automatically executed by jEdit is during the
+    "initializing properties" step. This means that implementations that need to
+    update or remove certain properties during upgrades can take advantage of this class. 
+    <p>
+    Example:
+    <pre>
+    <SERVICE CLASS="org.jedit.migration.OneTimeMigrationService" NAME="checkFileStatus" >
+	  new org.jedit.migration.CheckFileStatus();
+	</SERVICE>
+	</pre>
+    @author Alan Ezust
+    @since jEdit 5.1
+*/ 
+abstract public class OneTimeMigrationService implements MigrationService 
+{
+	/** Performs doMigrate() on each installed 
+		OneTimeMigrationService */
+	public static void execute()
+	{
+		String[] migrations = ServiceManager.getServiceNames(OneTimeMigrationService.class);
+		if (migrations.length == 0) return;
+		for (String migration: migrations)
+		{
+			Object obj = ServiceManager.getService(OneTimeMigrationService.class, migration);
+			OneTimeMigrationService svc = (OneTimeMigrationService) obj;
+			svc.doMigration();
+		}
+	}
+
+	protected String name;
+
+	/** @param name of this service. Used to identify and determine if it's been
+        done eariler. */	
+	public OneTimeMigrationService(String name)
+	{
+		this.name = name;
+	}
+	
+	/** Calls migrate() but only once per installation. */
+	public void doMigration() 
+	{
+		if (!jEdit.getBooleanProperty("migration.step." + name)) {
+			Log.log(Log.MESSAGE, this, "Performing migration step: " + name);
+			migrate();
+			jEdit.setBooleanProperty("migration.step." + name, true);
+		}
+	}
+}//}}}
diff --git a/org/jedit/options/CombinedOptions.java b/org/jedit/options/CombinedOptions.java
index 5aad1f9..05540f6 100644
--- a/org/jedit/options/CombinedOptions.java
+++ b/org/jedit/options/CombinedOptions.java
@@ -1,6 +1,6 @@
 /*
  * CombinedOptions.java - Combined options dialog
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:
  *
  * Copyright (C) 2011 Alan Ezust
@@ -52,6 +52,7 @@ public class CombinedOptions extends TabbedOptionDialog
 	public static CombinedOptions combinedOptions(Frame parent) 
 	{
 		int startingIndex = jEdit.getIntegerProperty("optional.last.tab", 0);
+		if (startingIndex > 1) startingIndex = 0;
 		return new CombinedOptions(parent, startingIndex);
 	}
 	
diff --git a/org/jedit/options/GlobalOptionGroup.java b/org/jedit/options/GlobalOptionGroup.java
index 08ad832..6069ea9 100644
--- a/org/jedit/options/GlobalOptionGroup.java
+++ b/org/jedit/options/GlobalOptionGroup.java
@@ -1,6 +1,6 @@
 /*
  * GlobalOptionGroup.java -
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:
  *
  * Copyright (C) 1998, 2003 Slava Pestov
diff --git a/org/jedit/options/OptionGroupPane.java b/org/jedit/options/OptionGroupPane.java
index 9930304..78bcbf2 100644
--- a/org/jedit/options/OptionGroupPane.java
+++ b/org/jedit/options/OptionGroupPane.java
@@ -1,6 +1,6 @@
 /*
  * OptionGroupPane.java - A Pane (view) for displaying/selecting OptionGroups.
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:
  *
  * Copyright (C) 2005 Slava Pestov
@@ -214,14 +214,14 @@ public class OptionGroupPane extends AbstractOptionPane implements TreeSelection
         // {{{ selectPane() methods
 	private boolean selectPane(OptionGroup node, String name)
 	{
-		return selectPane(node, name, new ArrayList());
+		return selectPane(node, name, new ArrayList<Object>());
 	} 
 
-	private boolean selectPane(OptionGroup node, String name, ArrayList path)
+	private boolean selectPane(OptionGroup node, String name, ArrayList<Object> path)
 	{
 		path.add(node);
 
-		Enumeration e = node.getMembers();
+		Enumeration<Object> e = node.getMembers();
 		while (e.hasMoreElements())
 		{
 			Object obj = e.nextElement();
@@ -285,17 +285,27 @@ public class OptionGroupPane extends AbstractOptionPane implements TreeSelection
 	// {{{ init() method
 	protected void _init()
 	{
-
 		setLayout(new BorderLayout());
 		deferredOptionPanes = new HashMap<Object, OptionPane>();
 		optionTreeModel = new OptionTreeModel();
 		OptionGroup rootGroup = (OptionGroup) optionTreeModel.getRoot();
-		rootGroup.addOptionGroup(optionGroup);
+
+		// #3608324: ignore the root node of the option group as it does not provide
+		// a label and only add its children
+		for (Enumeration<Object> members = optionGroup.getMembers(); members.hasMoreElements();)
+		{
+				Object member = members.nextElement();
+				if (member instanceof OptionGroup)
+						rootGroup.addOptionGroup((OptionGroup)member);
+				else if (member instanceof String)
+						rootGroup.addOptionPane((String)member);
+				// TODO are there any other cases that must handled?
+		}
+
 		paneTree = new JTree(optionTreeModel);
-		paneTree.setVisibleRowCount(1);
 		paneTree.setRootVisible(false);
 		paneTree.setCellRenderer(new PaneNameRenderer());
-
+		
 		JPanel content = new JPanel(new BorderLayout(12, 12));
 		content.setBorder(new EmptyBorder(12, 12, 12, 12));
 		add(content, BorderLayout.CENTER);
@@ -308,7 +318,7 @@ public class OptionGroupPane extends AbstractOptionPane implements TreeSelection
 
 		paneTree.setShowsRootHandles(true);
 		paneTree.setRootVisible(false);
-
+		
 		JScrollPane scroller = new JScrollPane(paneTree,
 			JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
 			JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
@@ -322,30 +332,16 @@ public class OptionGroupPane extends AbstractOptionPane implements TreeSelection
 		paneTree.getSelectionModel().addTreeSelectionListener(this);
 
 		OptionGroup rootNode = (OptionGroup) paneTree.getModel().getRoot();
-		for (int i = 0; i < rootNode.getMemberCount(); i++)
-		{
-			paneTree.expandPath(new TreePath(new Object[] { rootNode,
-				rootNode.getMember(i) }));
-		}
-
-		// returns false if no such pane exists; calling with null
-		// param selects first option pane found
 		String name = optionGroup.getName();
-		selectPane(rootNode, null);
-		/*
-		 * if ((defaultPaneName != null) && (!selectPane(rootNode,
-		 * defaultPaneName))) selectPane(rootNode, null);
-		 */
-
-		splitter.setDividerLocation(paneTree.getPreferredSize().width
-			+ scroller.getVerticalScrollBar().getPreferredSize().width);
-
 		String pane = jEdit.getProperty(name + ".last");
 		selectPane(rootNode, pane);
-
+		paneTree.setVisibleRowCount(1);
+		
 		int dividerLocation = jEdit.getIntegerProperty(name + ".splitter", -1);
 		if (dividerLocation != -1)
 			splitter.setDividerLocation(dividerLocation);
+		else splitter.setDividerLocation(paneTree.getPreferredSize().width
+					+ scroller.getVerticalScrollBar().getPreferredSize().width);
 
 	} //}}}
 
@@ -365,7 +361,7 @@ public class OptionGroupPane extends AbstractOptionPane implements TreeSelection
 		if (obj instanceof OptionGroup)
 		{
 			OptionGroup grp = (OptionGroup) obj;
-			Enumeration members = grp.getMembers();
+			Enumeration<Object> members = grp.getMembers();
 			while (members.hasMoreElements())
 			{
 				save(members.nextElement());
diff --git a/org/jedit/options/PluginOptionGroup.java b/org/jedit/options/PluginOptionGroup.java
index 970df01..49a5c08 100644
--- a/org/jedit/options/PluginOptionGroup.java
+++ b/org/jedit/options/PluginOptionGroup.java
@@ -1,6 +1,6 @@
 /*
  * PluginOptionGroup.java - Plugin options model
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Portions Copyright (C) 2003 Slava Pestov
diff --git a/org/jedit/options/TabbedOptionDialog.java b/org/jedit/options/TabbedOptionDialog.java
index 6a4f5bc..3e24f9d 100644
--- a/org/jedit/options/TabbedOptionDialog.java
+++ b/org/jedit/options/TabbedOptionDialog.java
@@ -1,6 +1,6 @@
 /*
  * TabbedOptionDialog.java - Options Dialog with tabs. 
- * :tabSize=8:indentSize=8:noTabs=false:
+ * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
  * Copyright (C) 2005 Slava Pestov
@@ -25,7 +25,6 @@ package org.jedit.options;
 
 import java.awt.BorderLayout;
 import java.awt.Dialog;
-import java.awt.Dimension;
 import java.awt.Frame;
 import java.awt.Point;
 import java.awt.event.ActionEvent;
@@ -191,7 +190,6 @@ public class TabbedOptionDialog extends EnhancedDialog implements ActionListener
 				op.save();
 		}
 		Point p = getLocation();
-		Dimension d = getSize();
 
 		/* This will fire the PROPERTIES_CHANGED event */
 		jEdit.propertiesChanged();
diff --git a/package-files/linux/jedit b/package-files/linux/jedit
index fd0fb86..960037b 100644
--- a/package-files/linux/jedit
+++ b/package-files/linux/jedit
@@ -18,5 +18,9 @@ else
 	JAVA="${JAVA_HOME}/bin/java"
 fi
 
+# Antialias menus and dockable text:
+ANTIALIAS_ALL="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true"
+
+
 # Launch application.
-exec "${JAVA}" -jar "/usr/share/jEdit/@jar.filename@" -reuseview "$@"
+exec "${JAVA}" ${ANTIALIAS_ALL} -jar "/usr/share/jEdit/@jar.filename@" -reuseview "$@"
diff --git a/package-files/os2/jedit.cmd b/package-files/os2/jedit.cmd
new file mode 100644
index 0000000..2391e4d
--- /dev/null
+++ b/package-files/os2/jedit.cmd
@@ -0,0 +1,73 @@
+/* MAINTAINERS: Robert Henschel (os2info at gmx.net)
+ *              Christoph vogt (ch.vogt at gmx.net)
+ *              Gili Tzabari (junk at bbs.darktech.org)
+ * PLATFORM: OS/2, eCS
+ * 
+ * Used to run JEdit 3.1
+ */
+
+
+rc = QueryJavaVersion()
+if (rc = -1) then
+do
+  say "java.exe cannot be found"
+  return -1;
+end
+if (rc = -2) then
+  say "Unexpected response to JAVA -VERSION. Assuming newest version is being used."
+
+arguments = "-settings=%HOME%\.jedit -server=%HOME%\.jedit\server"
+jedit_dir = GetExecPath()
+
+if (iMajor = 1 & iMid <= 1) then
+    'java -Xmx192M -classpath %classpath%;'jedit_dir'\jedit.jar org.gjt.sp.jedit.jEdit 'arguments
+  else
+    'java -Xmx192M -jar 'jedit_dir'\jedit.jar 'arguments
+
+return 0
+
+
+
+
+
+ /*
+  * Java version detector.
+  * Assumes java -version return quoted ("") version number.
+  * Written by os2bird on #netlabs
+  *
+  * Returns -1 on no java or failed to execute
+  *         -2 on invalid java version string.
+  *         version number.
+  */
+QueryJavaVersion: procedure expose iMajor iMid iMinor
+cQueued =  queued();
+'@echo off'
+'java -version 2>&1 | rxqueue /LIFO'
+i = queued();
+do while i > cQueued
+    pull sStr
+    if (pos("JAVA VERSION ", sStr) > 0) | (pos("JAVA.EXE VERSION ", sStr) > 0) then
+    do
+        do while(queued() > 0) 
+          pull sStrIngore; /* flush input stream */
+        end
+        parse var sStr sStuff '"'iMajor'.'iMid'.'iMinor'"'
+        if (iMinor <> '') then
+            return iMajor*100 + iMid * 10 + iMinor;
+         else
+             return -2
+     end
+     i = i - 1;
+ end
+ return -1;
+
+
+/*
+ * Returns the path of the script being executed.
+ */
+GetExecPath: procedure
+parse source result
+parse var result 'OS/2 ' dummy result                        /* Get full path of script */
+result=filespec("drive", result) || filespec("path", result) /* strip away filename */
+result=substr(result, 1, length(result)-1)                   /* remove backslash */
+return result
\ No newline at end of file
diff --git a/test/org/jedit/io/Native2ASCIIEncodingTest.java b/test/org/jedit/io/Native2ASCIIEncodingTest.java
new file mode 100644
index 0000000..ac1b493
--- /dev/null
+++ b/test/org/jedit/io/Native2ASCIIEncodingTest.java
@@ -0,0 +1,1598 @@
+/*
+ * jEdit - Programmer's Text Editor
+ * :tabSize=8:indentSize=8:noTabs=false:
+ * :folding=explicit:collapseFolds=1:
+ *
+ * Copyright © 2012 jEdit contributors
+ *
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+package org.jedit.io;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.Closeable;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PushbackReader;
+import java.io.Reader;
+import java.io.Writer;
+import java.lang.reflect.InvocationTargetException;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.MalformedInputException;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.gjt.sp.util.IOUtilities.closeQuietly;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.sameInstance;
+
+public class Native2ASCIIEncodingTest
+{
+	@BeforeClass
+	public static void oneTimeSetUp()
+	{
+		native2ASCIIEncoding = new Native2ASCIIEncoding();
+		iso_8859_1 = Charset.forName("ISO-8859-1");
+		bufferArray = new char[1024];
+		buffer = CharBuffer.wrap(bufferArray);
+	}
+
+	@AfterClass
+	public static void oneTimeTearDown()
+	{
+		native2ASCIIEncoding = null;
+		iso_8859_1 = null;
+		bufferArray = null;
+		buffer = null;
+	}
+
+	@Before
+	public void setUp()
+	{
+		buffer.clear();
+	}
+
+	@After
+	public void tearDown()
+	{
+		closeQuietly((Closeable)reader);
+		closeQuietly((Closeable)writer);
+	}
+
+	private Reader getReader(String input) throws IOException
+	{
+		InputStream inputStream = new ByteArrayInputStream(input.getBytes(iso_8859_1));
+		reader = native2ASCIIEncoding.getTextReader(inputStream);
+		return reader;
+	}
+
+	private Reader getThrottledReader(String input)
+		throws IOException, InvocationTargetException, NoSuchMethodException, IllegalAccessException,
+		       InstantiationException
+	{
+		InputStream inputStream = new ByteArrayInputStream(input.getBytes(iso_8859_1));
+		reader = native2ASCIIEncoding.getTextReader(inputStream, ThrottledPushbackReader.class);
+		return reader;
+	}
+
+	private Reader getPermissiveReader(String input) throws IOException
+	{
+		InputStream inputStream = new ByteArrayInputStream(input.getBytes(iso_8859_1));
+		reader = native2ASCIIEncoding.getPermissiveTextReader(inputStream);
+		return reader;
+	}
+
+	private Reader getThrottledPermissiveReader(String input)
+		throws IOException, InvocationTargetException, NoSuchMethodException, IllegalAccessException,
+		       InstantiationException
+	{
+		InputStream inputStream = new ByteArrayInputStream(input.getBytes(iso_8859_1));
+		reader = native2ASCIIEncoding.getPermissiveTextReader(inputStream, ThrottledPushbackReader.class);
+		return reader;
+	}
+
+	@Test
+	public void readShouldConvertEscapeSequence() throws IOException
+	{
+		int c = getReader("\\u21aF").read();
+		assertThat((char) c, is(equalTo('\u21aF')));
+	}
+
+	@Test
+	public void read_charArray_ShouldConvertEscapeSequence() throws IOException
+	{
+		int c = getReader("\\u21aF").read(bufferArray);
+		assertThat(c, is(equalTo(1)));
+		assertThat(bufferArray[0], is(equalTo('\u21aF')));
+	}
+
+	@Test
+	public void read_charArray_int_int_ShouldConvertEscapeSequence() throws IOException
+	{
+		int c = getReader("\\u21aF").read(bufferArray, 0, 1);
+		assertThat(c, is(equalTo(1)));
+		assertThat(bufferArray[0], is(equalTo('\u21aF')));
+	}
+
+	@Test
+	public void read_CharBuffer_ShouldConvertEscapeSequence() throws IOException
+	{
+		int c = getReader("\\u21aF").read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(1)));
+		assertThat(buffer.length(), is(equalTo(1)));
+		assertThat(buffer.toString(), is(equalTo("\u21aF")));
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void readShouldThrowExceptionOnIncompleteEscapeSequence() throws IOException
+	{
+		getReader("\\u21a").read();
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void read_charArray_ShouldThrowExceptionOnIncompleteEscapeSequence() throws IOException
+	{
+		getReader("\\u21a").read(bufferArray);
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void read_charArray_int_int_ShouldThrowExceptionOnIncompleteEscapeSequence() throws IOException
+	{
+		getReader("\\u21a").read(bufferArray, 0, 1);
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void read_CharBuffer_ShouldThrowExceptionOnIncompleteEscapeSequence() throws IOException
+	{
+		getReader("\\u21a").read(buffer);
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void readShouldThrowExceptionOnMissingInputAfterU() throws IOException
+	{
+		getReader("\\u").read();
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void read_charArray_ShouldThrowExceptionOnMissingInputAfterU() throws IOException
+	{
+		getReader("\\u").read(bufferArray);
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void read_charArray_int_int_ShouldThrowExceptionOnMissingInputAfterU() throws IOException
+	{
+		getReader("\\u").read(bufferArray, 0, 1);
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void read_CharBuffer_ShouldThrowExceptionOnMissingInputAfterU() throws IOException
+	{
+		getReader("\\u").read(buffer);
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void readShouldThrowExceptionOnMalformedInput() throws IOException
+	{
+		Reader reader = getReader("asdf\\: \\u21alasdf");
+		while (reader.read() != -1)
+		{
+		}
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void read_charArray_ShouldThrowExceptionOnMalformedInput() throws IOException
+	{
+		getReader("asdf\\: \\u21alasdf").read(bufferArray);
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void read_charArray_int_int_ShouldThrowExceptionOnMalformedInput() throws IOException
+	{
+		getReader("asdf\\: \\u21alasdf").read(bufferArray, 0, 15);
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void read_CharBuffer_ShouldThrowExceptionOnMalformedInput() throws IOException
+	{
+		getReader("asdf\\: \\u21alasdf").read(buffer);
+	}
+
+	@Test
+	public void permissiveReadShouldAcceptIncompleteEscapeSequence() throws IOException
+	{
+		Reader reader = getPermissiveReader("\\u21a");
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('u')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('2')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('1')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void permissiveRead_charArray_ShouldAcceptIncompleteEscapeSequence() throws IOException
+	{
+		Reader reader = getPermissiveReader("\\u21a");
+		int c = reader.read(bufferArray);
+		assertThat(c, is(equalTo(5)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+	}
+
+	@Test
+	public void permissiveRead_charArray_int_int_ShouldAcceptIncompleteEscapeSequence() throws IOException
+	{
+		Reader reader = getPermissiveReader("\\u21a");
+		int c = reader.read(bufferArray, 0, 5);
+		assertThat(c, is(equalTo(5)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+	}
+
+	@Test
+	public void permissiveRead_CharBuffer_ShouldAcceptIncompleteEscapeSequence() throws IOException
+	{
+		String input = "\\u21a";
+		Reader reader = getPermissiveReader(input);
+		int c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(5)));
+		assertThat(buffer.length(), is(equalTo(5)));
+		assertThat(buffer.toString(), is(equalTo(input)));
+	}
+
+	@Test
+	public void permissiveReadShouldAcceptMissingInputAfterU() throws IOException
+	{
+		Reader reader = getPermissiveReader("\\u");
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('u')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void permissiveRead_charArray_ShouldAcceptMissingInputAfterU() throws IOException
+	{
+		Reader reader = getPermissiveReader("\\u");
+		int c = reader.read(bufferArray);
+		assertThat(c, is(equalTo(2)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+	}
+
+	@Test
+	public void permissiveRead_charArray_int_int_ShouldAcceptMissingInputAfterU() throws IOException
+	{
+		Reader reader = getPermissiveReader("\\u");
+		int c = reader.read(bufferArray, 0, 2);
+		assertThat(c, is(equalTo(2)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+	}
+
+	@Test
+	public void permissiveRead_CharBuffer_ShouldAcceptMissingInputAfterU() throws IOException
+	{
+		String input = "\\u";
+		Reader reader = getPermissiveReader(input);
+		int c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(2)));
+		assertThat(buffer.length(), is(equalTo(2)));
+		assertThat(buffer.toString(), is(equalTo(input)));
+	}
+
+	@Test
+	public void permissiveReadShouldAcceptMalformedInput() throws IOException
+	{
+		Reader reader = getPermissiveReader("asdf\\: \\u21a/asdf");
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('s')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('d')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('f')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo(':')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo(' ')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('u')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('2')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('1')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('/')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('s')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('d')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('f')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void permissiveRead_charArray_ShouldAcceptMalformedInput() throws IOException
+	{
+		int c = getPermissiveReader("asdf\\: \\u21a/asdf").read(bufferArray);
+		assertThat(c, is(equalTo(17)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo(':')));
+		assertThat(bufferArray[i++], is(equalTo(' ')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('/')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+	}
+
+	@Test
+	public void permissiveRead_charArray_int_int_ShouldAcceptMalformedInput() throws IOException
+	{
+		int c = getPermissiveReader("asdf\\: \\u21a/asdf").read(bufferArray, 0, 17);
+		assertThat(c, is(equalTo(17)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo(':')));
+		assertThat(bufferArray[i++], is(equalTo(' ')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('/')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+	}
+
+	@Test
+	public void permissiveRead_CharBuffer_ShouldAcceptMalformedInput() throws IOException
+	{
+		String input = "asdf\\: \\u21a/asdf";
+		Reader reader = getPermissiveReader(input);
+		int c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(17)));
+		assertThat(buffer.length(), is(equalTo(17)));
+		assertThat(buffer.toString(), is(equalTo(input)));
+	}
+
+	@Test
+	public void readShouldCorrectlyHandleEOF() throws IOException
+	{
+		int c = getReader("").read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void read_charArray_ShouldCorrectlyHandleEOF() throws IOException
+	{
+		int c = getReader("").read(bufferArray);
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void read_charArray_int_int_ShouldCorrectlyHandleEOF() throws IOException
+	{
+		int c = getReader("").read(bufferArray, 0, 1);
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void read_CharBuffer_ShouldCorrectlyHandleEOF() throws IOException
+	{
+		int c = getReader("").read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(-1)));
+		assertThat(buffer.length(), is(equalTo(0)));
+	}
+
+	@Test
+	public void readShouldCorrectlyHandleEOFAfterBackslash() throws IOException
+	{
+		Reader reader = getReader("\\");
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void read_charArray_ShouldCorrectlyHandleEOFAfterBackslash() throws IOException
+	{
+		int c = getReader("\\").read(bufferArray);
+		assertThat(c, is(equalTo(1)));
+		assertThat(bufferArray[0], is(equalTo('\\')));
+	}
+
+	@Test
+	public void read_charArray_int_int_ShouldCorrectlyHandleEOFAfterBackslash() throws IOException
+	{
+		int c = getReader("\\").read(bufferArray, 0, 1);
+		assertThat(c, is(equalTo(1)));
+		assertThat(bufferArray[0], is(equalTo('\\')));
+	}
+
+	@Test
+	public void read_CharBuffer_ShouldCorrectlyHandleEOFAfterBackslash() throws IOException
+	{
+		String input = "\\";
+		int c = getReader(input).read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(1)));
+		assertThat(buffer.length(), is(equalTo(1)));
+		assertThat(buffer.toString(), is(equalTo(input)));
+	}
+
+	@Test
+	public void readShouldCorrectlyHandleLessThan5NonEscapeCharactersAfterBackslash() throws IOException
+	{
+		Reader reader = getReader("\\asdf");
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('s')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('d')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('f')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void read_charArray_ShouldCorrectlyHandleLessThan5NonEscapeCharactersAfterBackslash() throws IOException
+	{
+		int c = getReader("\\asdf").read(bufferArray);
+		assertThat(c, is(equalTo(5)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+	}
+
+	@Test
+	public void read_charArray_int_int_ShouldCorrectlyHandleLessThan5NonEscapeCharactersAfterBackslash()
+		throws IOException
+	{
+		int c = getReader("\\asdf").read(bufferArray, 0, 5);
+		assertThat(c, is(equalTo(5)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+	}
+
+	@Test
+	public void read_CharBuffer_ShouldCorrectlyHandleLessThan5NonEscapeCharactersAfterBackslash() throws IOException
+	{
+		String input = "\\asdf";
+		int c = getReader(input).read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(5)));
+		assertThat(buffer.length(), is(equalTo(5)));
+		assertThat(buffer.toString(), is(equalTo(input)));
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void readShouldThrowExceptionOnMalformedInputWithThrottledReader()
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		getThrottledReader("\\u21aL").read();
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void read_charArray_ShouldThrowExceptionOnMalformedInputWithThrottledReader()
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		getThrottledReader("\\u21aL").read(bufferArray);
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void read_charArray_int_int_ShouldThrowExceptionOnMalformedInputWithThrottledReader()
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		getThrottledReader("\\u21aL").read(bufferArray, 0, 1);
+	}
+
+	@Test(expected = MalformedInputException.class)
+	public void read_CharBuffer_ShouldThrowExceptionOnMalformedInputWithThrottledReader()
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		getThrottledReader("\\u21aL").read(buffer);
+	}
+
+	@Test
+	public void readShouldConvertEscapeSequenceWithThrottledInputStream()
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		int c = getThrottledReader("\\u21aF").read();
+		assertThat((char) c, is(equalTo('\u21aF')));
+	}
+
+	@Test
+	public void read_charArray_ShouldConvertEscapeSequenceWithThrottledInputStream()
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		int c = getThrottledReader("\\u21aF").read(bufferArray);
+		assertThat(c, is(equalTo(1)));
+		assertThat(bufferArray[0], is(equalTo('\u21aF')));
+	}
+
+	@Test
+	public void read_charArray_int_int_ShouldConvertEscapeSequenceWithThrottledInputStream()
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		int c = getThrottledReader("\\u21aF").read(bufferArray, 0, 1);
+		assertThat(c, is(equalTo(1)));
+		assertThat(bufferArray[0], is(equalTo('\u21aF')));
+	}
+
+	@Test
+	public void read_CharBuffer_ShouldConvertEscapeSequenceWithThrottledInputStream()
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		int c = getThrottledReader("\\u21aF").read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(1)));
+		assertThat(buffer.toString(), is(equalTo("\u21aF")));
+	}
+
+	@Test
+	public void readShouldReadBackslashWithoutFollowingUAsBackslash() throws IOException
+	{
+		Reader reader = getReader("\\nu21aF");
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('n')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('u')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('2')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('1')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('F')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void read_charArray_ShouldReadBackslashWithoutFollowingUAsBackslash() throws IOException
+	{
+		int c = getReader("\\nu21aF").read(bufferArray);
+		assertThat(c, is(equalTo(7)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('n')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('F')));
+	}
+
+	@Test
+	public void read_charArray_int_int_ShouldReadBackslashWithoutFollowingUAsBackslash() throws IOException
+	{
+		int c = getReader("\\nu21aF").read(bufferArray, 0, 7);
+		assertThat(c, is(equalTo(7)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('n')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('F')));
+	}
+
+	@Test
+	public void read_CharBuffer_ShouldReadBackslashWithoutFollowingUAsBackslash() throws IOException
+	{
+		String input = "\\nu21aF";
+		Reader reader = getReader(input);
+		int c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(7)));
+		assertThat(buffer.length(), is(equalTo(7)));
+		assertThat(buffer.toString(), is(equalTo(input)));
+	}
+
+	@Test
+	public void permissiveReadShouldAcceptMalformedInputWithThrottledReader()
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		Reader reader = getThrottledPermissiveReader("\\u21a;");
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('u')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('2')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('1')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo(';')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void permissiveRead_charArray_ShouldAcceptMalformedInputWithThrottledReader()
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		int c = getThrottledPermissiveReader("\\u21a;").read(bufferArray);
+		assertThat(c, is(equalTo(6)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo(';')));
+	}
+
+	@Test
+	public void permissiveRead_charArray_int_int_ShouldAcceptMalformedInputWithThrottledReader()
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		int c = getThrottledPermissiveReader("\\u21a;").read(bufferArray, 0, 6);
+		assertThat(c, is(equalTo(6)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo(';')));
+	}
+
+	@Test
+	public void permissiveRead_CharBuffer_ShouldAcceptMalformedInputWithThrottledReader()
+		throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException,
+		       IllegalAccessException
+	{
+		String input = "\\u21a;";
+		Reader reader = getThrottledPermissiveReader(input);
+		int c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(6)));
+		assertThat(buffer.length(), is(equalTo(6)));
+		assertThat(buffer.toString(), is(equalTo(input)));
+	}
+
+	@Test
+	public void read_charArray_shouldReadOnAfterCollapsingEscapeSequences() throws IOException
+	{
+		int c = getReader("asdf\\: \\u21aFasdf").read(bufferArray);
+		assertThat(c, is(equalTo(12)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo(':')));
+		assertThat(bufferArray[i++], is(equalTo(' ')));
+		assertThat(bufferArray[i++], is(equalTo('\u21aF')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+	}
+
+	@Test
+	public void read_charArray_int_int_shouldReadOnAfterCollapsingEscapeSequences() throws IOException
+	{
+		int c = getReader("asdf\\: \\u21aFasdf").read(bufferArray, 0, 12);
+		assertThat(c, is(equalTo(12)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo(':')));
+		assertThat(bufferArray[i++], is(equalTo(' ')));
+		assertThat(bufferArray[i++], is(equalTo('\u21aF')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+	}
+
+	@Test
+	public void read_CharBuffer_shouldReadOnAfterCollapsingEscapeSequences() throws IOException
+	{
+		int c = getReader("asdf\\: \\u21aFasdf").read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(12)));
+		assertThat(buffer.length(), is(equalTo(12)));
+		assertThat(buffer.toString(), is(equalTo("asdf\\: \u21aFasdf")));
+	}
+
+	@Test
+	public void readShouldIgnoreEscapeSequenceThatFollowsOneBackslash() throws IOException
+	{
+		Reader reader = getReader("\\\\u21aF");
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('u')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('2')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('1')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('F')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void read_charArray_ShouldIgnoreEscapeSequenceThatFollowsOneBackslash() throws IOException
+	{
+		int c = getReader("\\\\u21aF").read(bufferArray);
+		assertThat(c, is(equalTo(7)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('F')));
+	}
+
+	@Test
+	public void read_charArray_int_int_ShouldIgnoreEscapeSequenceThatFollowsOneBackslash() throws IOException
+	{
+		int c = getReader("\\\\u21aF").read(bufferArray, 0, 7);
+		assertThat(c, is(equalTo(7)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('F')));
+	}
+
+	@Test
+	public void read_CharBuffer_ShouldIgnoreEscapeSequenceThatFollowsOneBackslash() throws IOException
+	{
+		String input = "\\\\u21aF";
+		Reader reader = getReader(input);
+		int c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(7)));
+		assertThat(buffer.length(), is(equalTo(7)));
+		assertThat(buffer.toString(), is(equalTo(input)));
+	}
+
+	@Test
+	public void readShouldConvertEscapeSequenceThatFollowsTwoBackslashes() throws IOException
+	{
+		Reader reader = getReader("\\\\\\u21aF");
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\u21aF')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void read_charArray_ShouldConvertEscapeSequenceThatFollowsTwoBackslashes() throws IOException
+	{
+		int c = getReader("\\\\\\u21aF").read(bufferArray);
+		assertThat(c, is(equalTo(3)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\u21aF')));
+	}
+
+	@Test
+	public void read_charArray_int_int_ShouldConvertEscapeSequenceThatFollowsTwoBackslashes() throws IOException
+	{
+		int c = getReader("\\\\\\u21aF").read(bufferArray, 0, 3);
+		assertThat(c, is(equalTo(3)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\u21af')));
+	}
+
+	@Test
+	public void read_CharBuffer_ShouldConvertEscapeSequenceThatFollowsTwoBackslashes() throws IOException
+	{
+		Reader reader = getReader("\\\\\\u21aF");
+		int c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(3)));
+		assertThat(buffer.length(), is(equalTo(3)));
+		assertThat(buffer.toString(), is(equalTo("\\\\\u21aF")));
+	}
+
+	@Test
+	public void differentReadMethodsShouldBeUsableOnTheSameStream() throws IOException
+	{
+		Reader reader = getReader("asdf\\: \\u21aFasdf");
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('s')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('d')));
+
+		c = reader.read(bufferArray, 0, 3);
+		assertThat(c, is(equalTo(3)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('f')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo(':')));
+
+		c = reader.read();
+		assertThat((char) c, is(equalTo(' ')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\u21aF')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+
+		c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(3)));
+		assertThat(buffer.length(), is(equalTo(3)));
+		assertThat(buffer.toString(), is(equalTo("sdf")));
+	}
+
+	@Test
+	public void readShouldIgnoreEscapeSequenceThatFollowsThreeBackslashes() throws IOException
+	{
+		Reader reader = getReader("\\\\\\\\u21aF");
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('u')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('2')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('1')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('F')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void read_charArray_ShouldIgnoreEscapeSequenceThatFollowsThreeBackslashes() throws IOException
+	{
+		int c = getReader("\\\\\\\\u21aF").read(bufferArray);
+		assertThat(c, is(equalTo(9)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('F')));
+	}
+
+	@Test
+	public void read_charArray_int_int_ShouldIgnoreEscapeSequenceThatFollowsThreeBackslashes() throws IOException
+	{
+		int c = getReader("\\\\\\\\u21aF").read(bufferArray, 0, 9);
+		assertThat(c, is(equalTo(9)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('F')));
+	}
+
+	@Test
+	public void read_CharBuffer_ShouldIgnoreEscapeSequenceThatFollowsThreeBackslashes() throws IOException
+	{
+		String input = "\\\\\\\\u21aF";
+		Reader reader = getReader(input);
+		int c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(9)));
+		assertThat(buffer.length(), is(equalTo(9)));
+		assertThat(buffer.toString(), is(equalTo(input)));
+	}
+
+	@Test
+	public void readShouldIgnoreIncompleteEscapeSequenceThatFollowsOneBackslash() throws IOException
+	{
+		Reader reader = getReader("\\\\u21a");
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('u')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('2')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('1')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void read_charArray_ShouldIgnoreIncompleteEscapeSequenceThatFollowsOneBackslash() throws IOException
+	{
+		int c = getReader("\\\\u21a").read(bufferArray);
+		assertThat(c, is(equalTo(6)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+	}
+
+	@Test
+	public void read_charArray_int_int_ShouldIgnoreIncompleteEscapeSequenceThatFollowsOneBackslash()
+		throws IOException
+	{
+		int c = getReader("\\\\u21a").read(bufferArray, 0, 6);
+		assertThat(c, is(equalTo(6)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+	}
+
+	@Test
+	public void read_CharBuffer_ShouldIgnoreIncompleteEscapeSequenceThatFollowsOneBackslash() throws IOException
+	{
+		String input = "\\\\u21a";
+		Reader reader = getReader(input);
+		int c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(6)));
+		assertThat(buffer.length(), is(equalTo(6)));
+		assertThat(buffer.toString(), is(equalTo(input)));
+	}
+
+	@Test
+	public void readShouldIgnoreMalformedEscapeSequenceThatFollowsOneBackslash() throws IOException
+	{
+		Reader reader = getReader("asdf\\: \\\\u21alasdf");
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('s')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('d')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('f')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo(':')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo(' ')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('u')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('2')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('1')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('l')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('s')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('d')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('f')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void read_charArray_ShouldIgnoreMalformedEscapeSequenceThatFollowsOneBackslash() throws IOException
+	{
+		int c = getReader("asdf\\: \\\\u21alasdf").read(bufferArray);
+		assertThat(c, is(equalTo(18)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo(':')));
+		assertThat(bufferArray[i++], is(equalTo(' ')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('l')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+	}
+
+	@Test
+	public void read_charArray_int_int_ShouldIgnoreMalformedEscapeSequenceThatFollowsOneBackslash()
+		throws IOException
+	{
+		int c = getReader("asdf\\: \\\\u21alasdf").read(bufferArray, 0, 18);
+		assertThat(c, is(equalTo(18)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo(':')));
+		assertThat(bufferArray[i++], is(equalTo(' ')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo('u')));
+		assertThat(bufferArray[i++], is(equalTo('2')));
+		assertThat(bufferArray[i++], is(equalTo('1')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('l')));
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+	}
+
+	@Test
+	public void read_CharBuffer_ShouldIgnoreMalformedEscapeSequenceThatFollowsOneBackslash() throws IOException
+	{
+		String input = "asdf\\: \\\\u21alasdf";
+		Reader reader = getReader(input);
+		int c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(18)));
+		assertThat(buffer.length(), is(equalTo(18)));
+		assertThat(buffer.toString(), is(equalTo(input)));
+	}
+
+	@Test
+	public void differentReadMethodsShouldHaveACommonEscapeSequenceHandling() throws IOException
+	{
+		Reader reader = getReader("asdf\\: \\\\u21aFasdf");
+		int c = reader.read(bufferArray, 0, 8);
+		assertThat(c, is(equalTo(8)));
+		int i = 0;
+		assertThat(bufferArray[i++], is(equalTo('a')));
+		assertThat(bufferArray[i++], is(equalTo('s')));
+		assertThat(bufferArray[i++], is(equalTo('d')));
+		assertThat(bufferArray[i++], is(equalTo('f')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+		assertThat(bufferArray[i++], is(equalTo(':')));
+		assertThat(bufferArray[i++], is(equalTo(' ')));
+		assertThat(bufferArray[i++], is(equalTo('\\')));
+
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('u')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('2')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('1')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('a')));
+
+		c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(5)));
+		assertThat(buffer.length(), is(equalTo(5)));
+		assertThat(buffer.toString(), is(equalTo("Fasdf")));
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void skipShouldThrowExceptionIfToSkipIsNegative() throws IOException
+	{
+		getReader("asdf\\: \\\\u21alasdf").skip(-1);
+	}
+
+	@Test
+	public void skipShouldNotDoAnythingIfToSkipIsZero() throws IOException
+	{
+		String input = "asdf\\: \\\\u21alasdf";
+		Reader reader = getReader(input);
+		long skipped = reader.skip(0);
+		assertThat(skipped, is(equalTo(0L)));
+
+		int c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(18)));
+		assertThat(buffer.length(), is(equalTo(18)));
+		assertThat(buffer.toString(), is(equalTo(input)));
+	}
+
+	@Test
+	public void skipShouldSkipGivenAmountIfAvailable() throws IOException
+	{
+		Reader reader = getReader("asdf\\: \\\\u21alasdf");
+		long skipped = reader.skip(8);
+		assertThat(skipped, is(equalTo(8L)));
+
+		int c = reader.read(buffer);
+		buffer.flip();
+		assertThat(c, is(equalTo(10)));
+		assertThat(buffer.length(), is(equalTo(10)));
+		assertThat(buffer.toString(), is(equalTo("\\u21alasdf")));
+	}
+
+	@Test
+	public void skipShouldSkipAllIfToSkipIsGreaterThanInputLength() throws IOException
+	{
+		Reader reader = getReader("asdf\\: \\\\u21alasdf");
+		long skipped = reader.skip(20);
+		assertThat(skipped, is(equalTo(18L)));
+
+		int c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void multipleSkipCallsShouldWork() throws IOException
+	{
+		Reader reader = getReader("asdf\\: \\\\u21alasdf");
+		long skipped = reader.skip(5);
+		assertThat(skipped, is(equalTo(5L)));
+		skipped = reader.skip(10);
+		assertThat(skipped, is(equalTo(10L)));
+		skipped = reader.skip(5);
+		assertThat(skipped, is(equalTo(3L)));
+
+		int c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void textReaderWithNullAsClassParameterShouldWork()
+		throws IOException, InvocationTargetException, NoSuchMethodException, IllegalAccessException,
+		       InstantiationException
+	{
+		InputStream inputStream = new ByteArrayInputStream("asdf\\: \\\\u21alasdf".getBytes(iso_8859_1));
+		reader = native2ASCIIEncoding.getTextReader(inputStream, null);
+		long skipped = reader.skip(18);
+		assertThat(skipped, is(equalTo(18L)));
+
+		int c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void readerShouldBeAbleToDecodeWhatWriterHasEncoded() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		writer.write('\u21AF');
+		writer.flush();
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21AF")));
+		ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+		reader = native2ASCIIEncoding.getTextReader(bais);
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('\u21AF')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void readerShouldReadSingleCharactersIfWriterAddedAnEscapingBackslash() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		writer.write('\\');
+		writer.write('\u21AF');
+		writer.flush();
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\\\u21AF")));
+		ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+		reader = native2ASCIIEncoding.getTextReader(bais);
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('\\')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('u')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('2')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('1')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('A')));
+		c = reader.read();
+		assertThat((char) c, is(equalTo('F')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void readerShouldDecodeIfWriterHasWrittenEscapeSequenceAsSingleCharacters() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		writer.write('\\');
+		writer.write('u');
+		writer.write('2');
+		writer.write('1');
+		writer.write('a');
+		writer.write('F');
+		writer.flush();
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21aF")));
+		ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+		reader = native2ASCIIEncoding.getTextReader(bais);
+		int c = reader.read();
+		assertThat((char) c, is(equalTo('\u21aF')));
+		c = reader.read();
+		assertThat(c, is(equalTo(-1)));
+	}
+
+	@Test
+	public void write_int_ShouldEncodeASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		writer.write('\\');
+		writer.write('u');
+		writer.write('2');
+		writer.write('1');
+		writer.write('a');
+		writer.write('F');
+		writer.flush();
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21aF")));
+	}
+
+	@Test
+	public void write_charArray_int_int_ShouldEncodeASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		writer.write(new char[] { '\\', 'u', '2', '1', 'a', 'F' }, 0, 6);
+		writer.flush();
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21aF")));
+	}
+
+	@Test
+	public void write_String_int_int_ShouldEncodeASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		writer.write("\\u21aF", 0, 6);
+		writer.flush();
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21aF")));
+	}
+
+	@Test
+	public void write_charArray_ShouldEncodeASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		writer.write(new char[] { '\\', 'u', '2', '1', 'a', 'F' });
+		writer.flush();
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21aF")));
+	}
+
+	@Test
+	public void write_String_ShouldEncodeASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		writer.write("\\u21aF");
+		writer.flush();
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21aF")));
+	}
+
+	@Test
+	public void append_char_ShouldEncodeASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		Writer returnedWriter = writer.append('\\').append('u').append('2').append('1').append('a').append('F');
+		writer.flush();
+		assertThat(returnedWriter, is(sameInstance(writer)));
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21aF")));
+	}
+
+	@Test
+	public void append_CharSequence_int_int_ShouldEncodeASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		Writer returnedWriter = writer.append("\\u21aF", 0, 6);
+		writer.flush();
+		assertThat(returnedWriter, is(sameInstance(writer)));
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21aF")));
+	}
+
+	@Test
+	public void append_CharSequence_ShouldEncodeASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		Writer returnedWriter = writer.append("\\u21aF");
+		writer.flush();
+		assertThat(returnedWriter, is(sameInstance(writer)));
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21aF")));
+	}
+
+	@Test
+	public void write_int_ShouldEncodeNonASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		writer.write('\u21AF');
+		writer.flush();
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21AF")));
+	}
+
+	@Test
+	public void write_charArray_int_int_ShouldEncodeNonASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		writer.write(new char[] { '\u21AF' }, 0, 1);
+		writer.flush();
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21AF")));
+	}
+
+	@Test
+	public void write_String_int_int_ShouldEncodeNonASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		writer.write("\u21AF", 0, 1);
+		writer.flush();
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21AF")));
+	}
+
+	@Test
+	public void write_charArray_ShouldEncodeNonASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		writer.write(new char[] { '\u21AF' });
+		writer.flush();
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21AF")));
+	}
+
+	@Test
+	public void write_String_ShouldEncodeNonASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		writer.write("\u21AF");
+		writer.flush();
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21AF")));
+	}
+
+	@Test
+	public void append_char_ShouldEncodeNonASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		Writer returnedWriter = writer.append('\u21AF');
+		writer.flush();
+		assertThat(returnedWriter, is(sameInstance(writer)));
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21AF")));
+	}
+
+	@Test
+	public void append_CharSequence_int_int_ShouldEncodeNonASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		Writer returnedWriter = writer.append("\u21AF", 0, 1);
+		writer.flush();
+		assertThat(returnedWriter, is(sameInstance(writer)));
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21AF")));
+	}
+
+	@Test
+	public void append_CharSequence_ShouldEncodeNonASCIICharactersCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		Writer returnedWriter = writer.append("\u21AF");
+		writer.flush();
+		assertThat(returnedWriter, is(sameInstance(writer)));
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("\\u21AF")));
+	}
+
+	@Test
+	public void append_CharSequence_int_int_ShouldEncodeNullCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		Writer returnedWriter = writer.append(null, 0, 4);
+		writer.flush();
+		assertThat(returnedWriter, is(sameInstance(writer)));
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("null")));
+	}
+
+	@Test
+	public void append_CharSequence_ShouldEncodeNullCorrectly() throws IOException
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		writer = native2ASCIIEncoding.getTextWriter(baos);
+		Writer returnedWriter = writer.append(null);
+		writer.flush();
+		assertThat(returnedWriter, is(sameInstance(writer)));
+		assertThat(baos.toString("ISO-8859-1"), is(equalTo("null")));
+	}
+
+	private Reader reader;
+	private Writer writer;
+
+	private static Native2ASCIIEncoding native2ASCIIEncoding;
+	private static Charset iso_8859_1;
+	private static char[] bufferArray;
+	private static CharBuffer buffer;
+
+	private static class ThrottledPushbackReader extends PushbackReader
+	{
+		public ThrottledPushbackReader(Reader in, int size)
+		{
+			super(in, size);
+		}
+
+		@Override
+		public int read(char[] cbuf, int off, int len) throws IOException
+		{
+			if (cbuf == null)
+			{
+				throw new NullPointerException();
+			} else if (off < 0 || len < 0 || len > cbuf.length - off)
+			{
+				throw new IndexOutOfBoundsException();
+			}
+			int readChar = read();
+			if (readChar == -1)
+			{
+				return -1;
+			}
+			if (len == 0)
+			{
+				return 0;
+			}
+			cbuf[off] = (char) readChar;
+			return 1;
+		}
+	}
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jedit.git



More information about the pkg-java-commits mailing list