Mercurial > octave
comparison libgui/src/m-editor/file-editor-tab.cc @ 31646:c6d54dd31a7e stable
maint: Use macros to begin/end C++ namespaces.
* BaseControl.cc, BaseControl.h, ButtonControl.cc, ButtonControl.h,
ButtonGroup.cc, ButtonGroup.h, Canvas.cc, Canvas.h,
CheckBoxControl.cc, CheckBoxControl.h, Container.cc, Container.h,
ContextMenu.cc, ContextMenu.h, EditControl.cc, EditControl.h,
Figure.cc, Figure.h, FigureWindow.cc, FigureWindow.h, GLCanvas.cc,
GLCanvas.h, GenericEventNotify.h, KeyMap.cc, KeyMap.h,
ListBoxControl.cc, ListBoxControl.h, Logger.cc, Logger.h, Menu.cc,
Menu.h, MenuContainer.h, Object.cc, Object.h, ObjectProxy.cc,
ObjectProxy.h, Panel.cc, Panel.h, PopupMenuControl.cc,
PopupMenuControl.h, PushButtonControl.cc, PushButtonControl.h,
PushTool.cc, PushTool.h, QtHandlesUtils.cc, QtHandlesUtils.h,
RadioButtonControl.cc, RadioButtonControl.h, SliderControl.cc,
SliderControl.h, Table.cc, Table.h, TextControl.cc, TextControl.h,
TextEdit.cc, TextEdit.h, ToggleButtonControl.cc,
ToggleButtonControl.h, ToggleTool.cc, ToggleTool.h, ToolBar.cc,
ToolBar.h, ToolBarButton.cc, ToolBarButton.h, annotation-dialog.cc,
annotation-dialog.h, gl-select.cc, gl-select.h, qopengl-functions.h,
qt-graphics-toolkit.cc, qt-graphics-toolkit.h, QTerminal.h,
color-picker.cc, color-picker.h, command-widget.cc, command-widget.h,
community-news.cc, community-news.h, dialog.cc, dialog.h,
documentation-bookmarks.cc, documentation-bookmarks.h,
documentation-dock-widget.cc, documentation-dock-widget.h,
documentation.cc, documentation.h, dw-main-window.cc,
dw-main-window.h, external-editor-interface.cc,
external-editor-interface.h, files-dock-widget.cc,
files-dock-widget.h, find-files-dialog.cc, find-files-dialog.h,
find-files-model.cc, find-files-model.h, graphics-init.cc,
graphics-init.h, gui-settings.cc, gui-settings.h, gui-utils.cc,
gui-utils.h, history-dock-widget.cc, history-dock-widget.h,
interpreter-qobject.cc, interpreter-qobject.h, led-indicator.cc,
led-indicator.h, file-editor-interface.h, file-editor-tab.cc,
file-editor-tab.h, file-editor.cc, file-editor.h, find-dialog.cc,
find-dialog.h, marker.cc, marker.h, octave-qscintilla.cc,
octave-qscintilla.h, octave-txt-lexer.cc, octave-txt-lexer.h,
main-window.cc, main-window.h, news-reader.cc, news-reader.h,
octave-dock-widget.cc, octave-dock-widget.h, octave-qobject.cc,
octave-qobject.h, qt-application.cc, qt-application.h,
qt-interpreter-events.cc, qt-interpreter-events.h, qt-utils.h,
release-notes.cc, release-notes.h, resource-manager.cc,
resource-manager.h, set-path-dialog.cc, set-path-dialog.h,
set-path-model.cc, set-path-model.h, settings-dialog.cc,
settings-dialog.h, shortcut-manager.cc, shortcut-manager.h,
tab-bar.cc, tab-bar.h, terminal-dock-widget.cc,
terminal-dock-widget.h, variable-editor-model.cc,
variable-editor-model.h, variable-editor.cc, variable-editor.h,
welcome-wizard.cc, welcome-wizard.h, workspace-model.cc,
workspace-model.h, workspace-view.cc, workspace-view.h:
Use new macros to begin/end C++ namespaces.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 06 Dec 2022 14:37:51 -0500 |
parents | 5cc53fd090c3 |
children | 431f80aba37a 29d734430e5f |
comparison
equal
deleted
inserted
replaced
31644:9089bd969b37 | 31646:c6d54dd31a7e |
---|---|
93 #include "symtab.h" | 93 #include "symtab.h" |
94 #include "unwind-prot.h" | 94 #include "unwind-prot.h" |
95 #include "utils.h" | 95 #include "utils.h" |
96 #include "version.h" | 96 #include "version.h" |
97 | 97 |
98 namespace octave | 98 OCTAVE_BEGIN_NAMESPACE(octave) |
99 { | 99 |
100 //! A file_editor_tab object consists of a text area and three left margins. | 100 //! A file_editor_tab object consists of a text area and three left margins. |
101 //! The first holds breakpoints, bookmarks, and the debug program counter. | 101 //! The first holds breakpoints, bookmarks, and the debug program counter. |
102 //! The second holds line numbers. The third holds "fold" marks, to hide | 102 //! The second holds line numbers. The third holds "fold" marks, to hide |
103 //! sections of text. | 103 //! sections of text. |
104 | 104 |
595 } | 595 } |
596 } | 596 } |
597 } | 597 } |
598 } | 598 } |
599 | 599 |
600 | |
601 void file_editor_tab::update_lexer (void) | 600 void file_editor_tab::update_lexer (void) |
602 { | 601 { |
603 // Create a new lexer | 602 // Create a new lexer |
604 QsciLexer *lexer = nullptr; | 603 QsciLexer *lexer = nullptr; |
605 | 604 |
701 // use the old, existing one. | 700 // use the old, existing one. |
702 delete lexer; | 701 delete lexer; |
703 } | 702 } |
704 } | 703 } |
705 | 704 |
706 | |
707 // Update settings, which are lexer related and have to be updated | 705 // Update settings, which are lexer related and have to be updated |
708 // when | 706 // when |
709 // a) the lexer changes, | 707 // a) the lexer changes, |
710 // b) the settings have changed, or | 708 // b) the settings have changed, or |
711 // c) a package was loaded/unloaded | 709 // c) a package was loaded/unloaded |
840 | 838 |
841 for (octave_idx_type i = 0; i < bfl.numel (); i++) | 839 for (octave_idx_type i = 0; i < bfl.numel (); i++) |
842 api_entries.append (QString::fromStdString (bfl[i])); | 840 api_entries.append (QString::fromStdString (bfl[i])); |
843 } | 841 } |
844 | 842 |
845 | |
846 if (octave_functions) | 843 if (octave_functions) |
847 { | 844 { |
848 load_path& lp = interp.get_load_path (); | 845 load_path& lp = interp.get_load_path (); |
849 | 846 |
850 string_vector ffl = lp.fcn_names (); | 847 string_vector ffl = lp.fcn_names (); |
1137 prevline = m_edit_area->markerFindPrevious (m_edit_area->lines (), | 1134 prevline = m_edit_area->markerFindPrevious (m_edit_area->lines (), |
1138 (1 << marker::bookmark)); | 1135 (1 << marker::bookmark)); |
1139 | 1136 |
1140 m_edit_area->setCursorPosition (prevline, 0); | 1137 m_edit_area->setCursorPosition (prevline, 0); |
1141 } | 1138 } |
1142 | |
1143 | 1139 |
1144 QString file_editor_tab::get_all_bookmarks () | 1140 QString file_editor_tab::get_all_bookmarks () |
1145 { | 1141 { |
1146 QString bmlist; | 1142 QString bmlist; |
1147 int line = 0; | 1143 int line = 0; |
2858 m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETCARETPERIOD, 500); | 2854 m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETCARETPERIOD, 500); |
2859 else | 2855 else |
2860 m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETCARETPERIOD, 0); | 2856 m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETCARETPERIOD, 0); |
2861 | 2857 |
2862 } | 2858 } |
2863 | |
2864 | 2859 |
2865 void file_editor_tab::auto_margin_width (void) | 2860 void file_editor_tab::auto_margin_width (void) |
2866 { | 2861 { |
2867 m_edit_area->setMarginWidth (2, "1" + QString::number (m_edit_area->lines ())); | 2862 m_edit_area->setMarginWidth (2, "1" + QString::number (m_edit_area->lines ())); |
2868 } | 2863 } |
3296 return rxfun5.cap (1).remove (QRegExp ("[ \t]*")); | 3291 return rxfun5.cap (1).remove (QRegExp ("[ \t]*")); |
3297 } | 3292 } |
3298 | 3293 |
3299 return QString (); | 3294 return QString (); |
3300 } | 3295 } |
3301 } | 3296 |
3297 OCTAVE_END_NAMESPACE(octave) | |
3302 | 3298 |
3303 #endif | 3299 #endif |