Unryu: The Window
This page describes the main window: its parts and how to arrange them, the document tabs, the sidebar, the Details panel, the message window, the status bar, the toolbar and the whole View menu. It also explains how Unryu remembers the window's size and place, what happens when you start Unryu a second time, and gives an overview of every menu.
1. The parts of the window
From top to bottom, the window has a menu bar, a toolbar, the work area and a status bar. The work area holds four panels:
- The editor (the Source panel) is always in the middle, and has no header of its own to move it by (another panel can be docked beside or under it, see section 2). It has a tab for each open document.
- The sidebar is at the left at first, about 18% of the width. It has three pages: Symbols (the outline of the file), Documents (the open files) and Files (the project's folder).
- Details is at the right at first, about 32% of the width. It explains what is at the cursor.
- The message window is at the bottom at first, about 20% of the height. It has the tabs Status, Compiler, Messages, Tasks and Terminal.
The title bar of the window shows the path of the active document, the name of its project if it has one,
and "Unryu", for example */home/me/src/a.c - myproject - Unryu. A "*" at the start means that the
document has unsaved changes. With no file, the title is "Unryu" ("*Unryu" once you type in it).
2. Arranging the panels
The sidebar, Details and the message window each have a header with their title and three small icons: a pin, an options button ("...") and a close button. The editor has no header and always stays in the middle.
| What you want | How to do it |
|---|---|
| Make a panel larger or smaller | Drag the divider between two panels (it has a row of dots). |
| Move a panel to another edge | Drag its header to the left, right or bottom edge; the place where it will go is highlighted. A panel can also go beside or under another panel on the same edge. Or use the options button: Move to Left, Move to Right, Move to Bottom (the edge it is on now is greyed). Dropped over the editor, a panel docks beside or under it. Dropped near a bottom corner, a panel at the bottom runs under only the middle and that side, and the panel on the other side takes the full height. |
| Put a panel in a window of its own | Drag its header out of the main window, or choose Float in the options button's menu. A floating panel can be moved by its header and resized by its corners. Choose Dock in the same menu, or drag it back to an edge, to put it back. |
| Lock a panel in place | Click its pin icon. A pinned panel cannot be dragged, and the Move and Float/Dock items of its menu are greyed. Click the pin again to unlock it. |
| Collapse a panel to the edge | Options button > Auto Hide. The panel becomes a button in a thin strip along its edge. Click the button to show the panel over the others; click anywhere else to hide it again. Choose Auto Hide again to turn this off. |
| Close a panel | Click its close button, or Options button > Close. View > Show Sidebar, Show Details or Show Message Window brings it back. |
| Start again from the first layout | View > Reset Layout shows all four panels again, turns off Auto Hide, and puts them back at their first places and sizes: the sidebar at the left and the message window at the bottom, whatever Preferences > Interface > Position says. |
The options menu of the sidebar also has the Symbols list's own items: Sort by Name, Sort by Appearance, Expand All and Collapse All (see section 4).
Unryu saves the layout when it quits, in ~/.config/unryu/dock_layout.txt, and uses it at the next start.
Preferences > Interface > Interface also chooses the side of the sidebar (Position: Left or Right) and of the
message window (Position: Bottom or Right); a change there moves the panel when you apply it.
3. Documents and tabs
Each open document has its own tab above the editor. Each document keeps its own text, its own Undo history, its own cursor and scroll position, and its own analysis (see Analysis). The menus, the sidebar, Details and the status bar always show the active document.
The tab label
- The label is the file's name. A document without a file is "untitled", or a name such as "untitled.c" when it was made from a template (File > New (with Template)).
- A "*" before the name means unsaved changes. If you undo back to the saved text, the "*" goes away.
- A long name is shortened with "..." in the middle. Preferences > Interface > Notebook tabs > Tab label length sets the most characters a label shows (99 at first); 0 shows names in full.
Opening, switching and closing
- Opening a file that is already open goes to its tab instead of opening it twice. If the active tab is an empty, unchanged "untitled" one, the next file you open goes into it.
- Click a tab to show it. The keyboard stays in the editor, so you can type at once.
- Ctrl+Page Up and Ctrl+Page Down go to the tab on the left or on the right. At the first or the last tab they wrap around to the other end.
- Ctrl+Tab goes to the document you used last. Pressing it again quickly (within about a second) goes one further back in the order you used them. When you stop, the document you reached becomes the most recent one.
- Close a tab with its × button, with File > Close (Ctrl+W), or with File > Close Other Documents or Close All (Ctrl+Shift+W). If the document has unsaved changes, Unryu asks first (see Files and Recovery).
- After a tab closes, Unryu shows the tab that was next to it. With Preferences > Interface > Notebook tabs > "Switch to last used document after closing a tab", it shows the document you used last instead.
- Unryu always keeps at least one tab. When you close the last one, an empty "untitled" tab takes its place.
- At most 256 documents can be open at the same time. Opening one more says "Could not open the file ... Too many files are open."
- Go to Definition (Ctrl+T, F12 or Ctrl+click) into another file opens that file in a tab. Navigate > Back (Alt+Left) brings you back.
The order of the tabs
- Drag a tab along the row to move it. (This works when the tabs are at the top or the bottom.) The tab follows the pointer, drawn over the others, and a gap in the row shows where it will drop. When the pointer passes the middle of the next tab, that tab slides over into the gap, and the gap moves on. Release the button and the tab slides into the gap.
- Ctrl+Shift+Page Up and Ctrl+Shift+Page Down move the active tab one place to the left or the right. They wrap around at the ends.
- Preferences > Interface > Notebook tabs > "Placement of new file tabs" puts a new tab at the Left or the Right end of the row. With "Next to current", it goes just after the active tab instead. This does not apply to the tabs that Unryu opens again at the start.
- A double click on the empty part of the row, beside the tabs, opens a new document there, as File > New does (see Files and Recovery).
- Unryu reopens the tabs of the last session in their order at the next start, if Preferences > General > Startup > "Load files from the last session" is on (see Files and Recovery).
When the tabs do not fit
When the tabs are at the top or the bottom and there are more than the row can show, two arrows appear at the right end of the row. The left arrow goes to the tab before the active one and the right arrow to the tab after it; the row scrolls so that the tab stays in view. The arrows do not wrap around: at the first or the last tab they do nothing. The mouse wheel over the row scrolls it without changing the active tab.
Tab settings
Preferences > Interface > Notebook tabs has these settings for the editor's tabs:
| Setting | What it does |
|---|---|
| Show editor tabs | Shows or hides the row of tabs. Without it, use the keys or the Documents list to change documents. |
| Show close buttons | Shows or hides the × on each tab. |
| Placement of new file tabs: Left / Right, Next to current | Where a new tab goes (see above). |
| Double-clicking hides all additional widgets | A double click on a tab does the same as View > Toggle All Additional Widgets (section 10). A double click beside the tabs opens a new document, with this setting on or off. |
| Switch to last used document after closing a tab | See above. |
| Tab label length | See above. |
| Tab positions: Editor, Sidebar, Message window | Puts each set of tabs at the Top (the default), Bottom, Left or Right of its panel. Tabs at the left or right are a column, one under another. |
4. The sidebar
The sidebar has three pages, each with its tab: Symbols, Documents and Files. Each page scrolls in both directions when its list is larger than the page, with scrollbars; the mouse wheel scrolls up and down; to scroll across, drag the horizontal scrollbar. The lists use the editor theme's colors, so they look like part of the code they list.
Symbols (the outline)
Symbols lists what the active file declares, in groups: Functions, Types, Variables, Macros, Constants and Headings
(for Markdown and other documents). Only the groups the file has are shown, each with its count, such as "Functions (12)".
Each row shows the name in the color the editor gives its kind, then its line number: parse_line() :40.
A function's name ends in "()", a struct's in " {}".
- A member is listed under its type, a method under its class, and a heading under its parent heading. A function is listed once: at its definition if the file has one.
- The symbol that holds the cursor is marked with the color of the cursor's line, and the mark follows the cursor.
- A click on a row, or the arrow keys on it, shows that symbol in the editor. The keyboard stays in the list, so the arrow keys go on through the symbols. A click is also a jump that Navigate > Back can return from; moving with the arrow keys is not.
- At first all groups are open. In a Markdown document every heading is open too, down to the last level.
- The right-click menu (and the sidebar's options button) has Sort by Name and Sort by Appearance (the order of the file), Expand All (every group, and every row that has rows under it) and Collapse All (every group). Unryu remembers the sort order. Preferences > Interface > Interface > "Default sorting mode" sets it too. Sort by Name is the default.
- While you type, the list is brought up to date at most every 250 milliseconds. Preferences > Editor > Completions > "Symbol list update frequency" changes this; 0 updates it only when the file is saved. The list is rebuilt only when what it lists changes, so typing inside a function does not make it jump.
What the outline contains for each language is described in Analysis.
Documents
Documents lists the open documents, each under its folder (your home folder is shown as ~). Folders
are sorted by name and files by name within them; documents without a file are at the top. A file with unsaved changes
is bold, in the color of a changed line. A file in which the last build found an error or a warning is in that color.
A click on a document shows its tab, and the list follows when you change tabs another way.
Files
Files shows the folder of the active document's project as a tree, folders first, then files, each sorted by name (see Build and Run for how Unryu finds the project). With no project it says "No project (Tools > Set Project Folder)".
- Click a folder's arrow to open or close it. Press Enter or double-click a file to open it (or to go to its tab if it is open already). Opening a file this way is a jump that Back can return from.
- The list leaves out hidden names (starting with "."), what a build makes (
*.o,*.obj,*.a,*.so,*.so.*,*.pyc,*.class,*~,*.swp,__pycache__,node_modules), the patterns in the.gitignoreat the top of the project (lines starting with "!" are not understood), and the patterns of the project's own settings (hide = ...). - Each file has a color and an icon by its kind, taken from the editor theme: headers, source code, build files, documents, settings and data each have their own, and pictures, archives and programs are quiet. An open file is bold. As in Documents, unsaved files and files with build errors or warnings have those colors instead. With an icon theme (Preferences > Interface > Themes > Icons, see Themes), each file shows the theme's icon for its type instead, as a file manager shows it, and each folder the theme's folder; the colors stay.
- Following the document in front. When you bring a document to the front, its folders open in the tree and its row is chosen and scrolled into sight. Turn it off (or on again) with Follow the Current Document in the right-click menu.
- The right-click menu. On a row: Open; New File... and New Folder... (in that folder, or beside that file; a new file opens in a tab); Rename... (an open document of it, or in it, follows to the new name); Delete... (it asks first; a file is gone for good, and only an empty folder can be deleted; close a file's tab first). Then Mark Folder (Unmark Folder), Filter..., Clear Filter, Follow the Current Document and Read Again. While a workbench is open, a folder's row also has Add to the Workbench as a Project and, for a folder of the workbench, Take Out of the Workbench.
- A workbench's projects and folders. While a workbench is open (File > Workbench, see
Files), the tree is the folder of the workbench that holds the project in front,
such as
~/Projects. The project in front is in its place in that tree, not on its own. The workbench's projects inside the tree are bold, with a project icon; the other folders in it are plain. Each project and folder of the workbench that is not inside the tree stands at the top, by its name, as a tree of its own. The.gitignoreand hide patterns of the project in front leave names out only inside that project. - Marked folders stand at the top of the tree with a star: a double click (or Enter) opens that folder in the
tree. They are kept between sessions, in
marked-folders.txt, and each project shows its own. - The filter shows only the files whose names match one of its patterns (
*.c *.h; a pattern with no*or?is a part of the name), in any case; folders always show. A row at the top says what it shows; Clear Filter shows every file again. It lasts until Unryu quits. - The list is read again when it may have changed: another project, a file saved, a build, or when you come back to the Unryu window from another program.
Debug
While the debugger runs (Debug > Start), the sidebar has a Debug page: where the program stopped, its stack, its local variables, the watches and the breakpoints. See Debugging.
Sidebar settings
Preferences > Interface > Interface > Sidebar has: Show sidebar; Show symbol list (with its Default sorting mode); Show documents list; Show files list; and Position (Left or Right). A page that is turned off loses its tab; when only one page is left, the sidebar shows it without tabs. Turning off all three pages hides the sidebar. The font of the lists is Preferences > Interface > Interface > Fonts > Symbol list.
With Preferences > General > Miscellaneous > "Auto-focus widgets (focus follows mouse)", the editor and the Symbols and Documents lists take the keyboard as soon as the pointer moves over them.
5. Details
Details is a read-only panel that explains what Unryu knows about the place of the cursor. It changes as the cursor moves. From top to bottom it can show:
| Part | What it shows |
|---|---|
| Analysis | Why the answers are old or missing, for example when the analysis could not run. |
| Unsaved Text | A problem with the recovery copy of unsaved text (see Files and Recovery). |
| The compiler accepts | The repairs that the compiler check found, numbered for Ctrl+Alt+1 to Ctrl+Alt+9. |
| The name at the cursor | Its kind and name ("Function sum"), its declaration in the editor's colors, where it is declared, and its
documentation comment. For a name from another file: the declaration and documentation from the header that declares it. For an
#include line: the header's path. |
| The brace at the cursor | Its partner, how certain the pair is and why. |
| Markdown | For a Markdown document: words, characters and reading time; headings; links and images, with any that lead nowhere; code blocks, tables, to-do items, quotes, footnotes; and a table of contents. |
| Compiler | What Ctrl+Shift+B would do now and which project flags it uses. |
| File | The number of lines, the project, how many functions, types, variables, macros, constants or headings the file declares, and the brace counts (certain, likely, ambiguous, missing a partner, extra). |
| Unterminated | Comments and strings that are not closed, with their line and column. |
The meaning of each part is explained in Analysis. The Help menu also shows its pages here (Keyboard Shortcuts, Debug Messages, Colors, Compiler); they stay until the cursor moves or the file is analyzed again.
Preferences > Interface > Interface > Details > "Wrap code in Details" (on at first) wraps long declarations instead of letting them run off to the right. The font is Preferences > Interface > Interface > Fonts > Details. View > Show Details shows or hides the panel. You can select its text; its right-click menu has Copy and Select All.
Comments come from the file, and the file may not be trustworthy. Before Details shows a comment as Markdown,
Unryu turns ![ and raw HTML into plain characters, so a comment cannot make the panel load an image or another file.
6. The tooltip over a name
When the pointer rests over a name in the editor, a popup appears after a short pause. It shows the declaration in the editor's font and colors, a line, then the documentation, and at the bottom a band with the kind, the file and the line:
The band shows the file's name for a name declared in this file. For a name from another file, it shows that file's path
from the folder the two files share (or from ~, or in full).
When the last build reported an error, a warning or a note on the line under the pointer, the popup shows it at its top, even where there is no name.
You can move the pointer into the popup. It scrolls, and its bottom band stays in view. Its links (the names in the declaration, Declared, Defined, the uses, Show in Details and others) go to places without closing it; what they do is described in Analysis.
- Drag the popup's corner to change its size.
- Ctrl+wheel inside the popup makes its text larger or smaller; Ctrl+middle click returns it to the normal size. While the size is not the normal one, the band has a "Reset text size" link.
- Unryu remembers the popup's size and text size (
popup-width,popup-heightandpopup-font-deltain~/.config/unryu/unryu.conf).
7. The message window
The message window collects what Unryu has to report. It has five tabs:
| Tab | What it holds |
|---|---|
| Status | The messages Unryu logs (files opened, saved and closed, builds, errors), each with the time it came (for example 14:02:31: File /home/me/a.c saved.).
The newest is at the bottom; the last 1000 are kept. Failures are shown in the error color. |
| Compiler | What the last build wrote, one line at a time as it comes. A line that names a file and a line has an icon for an error, a warning or a note; click it to go there. Build > Next Error and Previous Error step through them. See Build and Run. |
| Messages | The results of Find All, Find Usage, Find Document Usage and Find in Files, and the errors of the compiler check,
one line for each (file:line: text), with the found text highlighted. Click a line to open its document at that place; if you closed
the document, Unryu opens the file again. Search > Next Message and Previous Message go through the list. See
Find and Replace. |
| Tasks | Every task the comments name: TODO, FIXME, XXX, HACK and
BUG, in capitals, as words, with the rest of their line. The document in front's come first, as it is now; then
each other file of the project's, from the project index. Only comments count: a TODO in a string or in code is
not a task. A click goes to it. The last line counts the tasks and the files. |
| Terminal | Unryu's own terminal, running your shell, started in the active document's folder when you first show the tab. See Build and Run. |
- Each line is shown in full; a list that is wider than the window scrolls across (Shift+wheel).
- Paths are shown in the link color and line numbers quietly, so that the place of each line is easy to see.
- A tab that is not showing tells you what is happening in it by the color of its label: the "running" color while a build or a Find in Files runs, then the color of how it ended (success, the "attention" color for warnings, or failure for a build; success when a search found matches). The color goes away when you show the tab. The Terminal tab does the same for the commands you run in it, and also shows the "attention" color while text waits at its prompt, even while the tab is shown. (For the Terminal this needs Preferences > Terminal > Shell integration.)
- When a search, a build or a check has something to show, Unryu opens the message window and its tab if they are hidden.
Settings for the message window:
| Setting | What it does |
|---|---|
| View > Show Message Window | Shows or hides it. |
| Preferences > Interface > Interface > Message window > Position | Bottom or Right. |
| Preferences > Interface > Notebook tabs > Tab positions > Message window | Its tabs at the Top (default), Bottom, Left or Right. |
| Preferences > Interface > Interface > Fonts > Message window | The font of its lists. |
| Preferences > General > Miscellaneous > Switch to status message list at new message | Brings the Status tab to the front each time a message arrives. |
| Preferences > General > Startup > Load virtual terminal support | Gives the message window its Terminal tab. It takes effect the next time Unryu starts. |
8. The status bar
The status bar is the line at the bottom of the window. As you move the cursor it shows the active document's path
("(no file)" for a document that has none), its encoding (with "(with BOM)" when the file has one) and its brace counts, for example
/home/me/a.c | UTF-8 | 40 braces: 38 certain, 2 likely, 0 ambiguous, 0 missing a partner, 0 extra.
When Unryu has something to tell you ("File saved.", "No matches found ...", "Editor font: 12 (zoom +2).") it shows that message
until the cursor moves or the file is analyzed again. Many messages (for example "File ... saved.", "Compilation finished
successfully.") also go to the Status tab of the message window, with their time. Short notes such as "No matches found ..." or
"Editor font: 12 (zoom +2)." are shown only in the status bar. The line with the path, encoding and braces is never written to
the Status tab.
- Preferences > Interface > Interface > Miscellaneous > Show status bar shows or hides it.
- Preferences > General > Miscellaneous > "Suppress status messages in the status bar" sends messages only to the Status tab, short notes included. The status bar then shows only its own line with the path, encoding and braces.
- Preferences > Interface > Interface > Fonts > Status bar sets its font; the bar grows to fit a larger font.
The icon in the system tray
When your desktop has a system tray, Unryu puts its icon there (Preferences > Interface > Interface > Miscellaneous > "Show an icon in the system tray", on at first; with no tray, nothing shows until one starts). A click on the icon hides the window (it is iconified) or shows it again.
Its right-click menu has:
- Hide Window (Show Window while it is hidden).
- New Document: a new, empty document, as File > New makes.
- Open File...: the Open dialog.
- Paste as New Document: a new document that holds what you copied, from Unryu or from another program.
- Save All (N unsaved), only while a document has changes that are not saved: saves them, as File > Save All does.
- Stop Build, only while a build runs: stops it, as its row in the Build menu does. The window stays as it is.
- Quit, which asks about unsaved changes as File > Quit does.
Every item but Stop Build brings the window up first, since it works there.
When the pointer rests on the icon, its tooltip says what goes on, one thing to a line: the open workbench, how many documents are unsaved, the build that runs (its command), a Find in Files search, the program being debugged or run, and a macro being recorded. With none of these, it says "Nothing unsaved, nothing running". A tooltip on the screen follows at once when something changes. Nothing is cut short: the tooltip moves along the edge of the screen to stay on it, and a line wider than the screen wraps.
While the window is hidden, the tray tells you when a build ends: "Build finished: 2 errors, 1 warning", or "Build finished: no errors" (not every tray shows such notes).
9. The toolbar
The toolbar is the row of buttons under the menu bar. Each button does the same as its menu item, and shows a short explanation when the pointer rests on it. A button is greyed when its menu item is: Undo and Redo when there is nothing to undo or redo, and Compile, Build and Execute when there is no command for them or no file. While Compile or Build runs, the other of the two is greyed, and the running one's button stops it. Execute is independent: while it runs, its button stops it.
These are all the items the toolbar can have. The default toolbar has New, Open, Save, Save All, Reload, Close, Back, Forward, Build, Execute, Color Chooser, the Find field, Find, the Line field and Go to Line, with separators between the groups.
| Item | What it does |
|---|---|
| New | File > New. |
| Open | File > Open. The small arrow beside it opens a list of the recent files; choose one to open it. |
| Save, Save All | File > Save, Save All. |
| Reload | File > Reload: the file again from the disk. |
| Close, Close All | File > Close, Close All. |
| Back, Forward | Navigate > Back, Forward. |
| Undo, Redo | Edit > Undo, Redo. |
| Cut, Copy, Paste, Delete | Edit > Cut, Copy, Paste, Delete. |
| Find field | Type text to find it in the current document. It finds as you type: the match grows where it is. Enter finds the next match, and so does the Find button beside it. Escape returns to the editor. |
| Find | Finds the next match of the Find field's text. |
| Replace | Search > Replace. |
| Line field | Type a line number and press Enter (or the Go to Line button) to go there. (Relative moves, +N or -N, work only in
Search > Go to Line.) Escape returns to the editor. |
| Go to Line | Goes to the Line field's line. |
| Zoom In, Zoom Out | View > Zoom In, Zoom Out. |
| File > Print. | |
| Preferences | Edit > Preferences. |
| Quit | File > Quit. |
| Compile, Build, Execute | The first and second commands of the Build menu's language group (Compile, Build; for a Makefile, Make and Make Custom Target...) and its Execute command. Compile is not on the toolbar at first: for one file, Build does what Compile does and links the program too. See Build and Run. |
| Color Chooser | Tools > Color Chooser (section 13). |
| Indent, Unindent | Edit > Format > Increase Indent, Decrease Indent. |
| Separator | A thin line between groups of buttons. |
Changing the toolbar
Preferences > Interface > Toolbar has:
- Show toolbar (also View > Show Toolbar).
- Append toolbar to the menu: the toolbar goes into the menu bar's row, after the menu titles, which saves a row. This applies only while the menu bar is shown.
- The toolbar editor. Its upper box is the toolbar in small; the lower box holds the items the toolbar does not have. Drag an item from the lower box into the toolbar to add it; a mark shows where it will go. Drag an item along the toolbar to move it, or drag it out of the toolbar box (for example into the lower box) to remove it. Each item can be in the toolbar once, except Separator, which you can add as often as you like. The line under the boxes names the item under the pointer, or says what a drop will do. An item that would not fit in the toolbar's two rows is not added. Click Default (at the top right) to go back to Unryu's own items. The change takes effect when you apply Preferences.
- Icon style: System default (images only), Images and text (the label under each icon), Images only, or Text only.
- Icon size: System default (24 pixels), Small icons (16), Very small icons (12) or Large icons (32).
- Icon look: Full color (the icon theme's own icons) or Symbolic (one color, the toolbar's text color: the theme's symbolic icons, else Adwaita's, else Unryu's own). See Themes.
The list of items is kept in unryu.conf as names separated by spaces (New, Open, Save, SaveAll, Revert, Close,
CloseAll, NavBack, NavFor, Undo, Redo, Cut, Copy, Paste, Delete, SearchEntry, Search, Replace, GotoEntry, Goto, ZoomIn, ZoomOut,
Print, Preferences, Quit, Compile, Build, Run, Color, Indent, UnIndent, Separator). A name Unryu does not know is ignored.
10. The View menu
All items of the View menu, in their order. Each "Show" item is a check item: it shows a check mark while it is on. Unryu remembers every setting here except Fullscreen, Toggle All Additional Widgets and the zoom.
| Item | Keys | What it does |
|---|---|---|
| Change Font... | Opens Preferences. The fonts of the editor, the interface, the symbol list, the message window, Details and the status bar are on Preferences > Interface > Interface > Fonts. | |
| Change Color Scheme... | Opens a list of the editor themes (the colors of the text). Under the list, a note describes the theme or says where its colors come from. The theme you click or move to with the arrow keys (also Page Up, Page Down, Home, End) is applied at once. Close, Escape, Enter or Alt+C closes the list. See Themes. | |
| Change Theme... | The same kind of list for the window themes (the menus, toolbar, panels and dialogs). The note says whether a theme is Unryu's own or installed (read only), and where its file is. | |
| Show Markers Margin | The narrow margin at the left of the text where markers (bookmarks, Ctrl+M) show. A click in it sets or removes a marker. See Editing. | |
| Show Line Numbers | The line numbers at the left of the text, in all documents. On at first. | |
| Show White Space | Shows spaces and tabs as visible marks. | |
| Show Line Endings | Shows the line ending at the end of each line. With Preferences > Editor > Display > "Show only non-default line endings", only endings other than the default one are shown. | |
| Show Indentation Guides | Thin vertical lines at each indentation level. | |
| Fullscreen | F11 | Fills the whole screen with the window, without the window manager's frame. Again to leave it. |
| Toggle All Additional Widgets | Hides the sidebar, the message window, the toolbar and the status bar, so that only the menu bar, the editor and Details remain. The next use brings back those that were shown before. A double click on one of the editor's tabs does the same when Preferences > Interface > Notebook tabs > "Double-clicking hides all additional widgets" is on. | |
| Show Message Window | Shows or hides the message window. | |
| Show Toolbar | Shows or hides the toolbar. | |
| Show Sidebar | Shows or hides the sidebar. | |
| Show Details | Shows or hides Details. | |
| Show Menubar | F10 | Shows or hides the menu bar. When you hide it, the status bar tells you which key brings it back (F10, or the key you gave it in Preferences > Keybindings). If you removed that key, the status bar says so. |
| Split Window ▸ | A second view beside the document or under it, showing the same document or another. See Split window below. | |
| Show Minimap | The whole document drawn small beside the scrollbar. See The minimap below. | |
| Zoom In | Ctrl++ (also Ctrl+=, keypad +) | The editor's font one point larger, in all documents. |
| Zoom Out | Ctrl+- (also keypad -) | The editor's font one point smaller. |
| Normal Size | Ctrl+0 | The editor's font at its normal size again. |
| Syntax Highlighting | Turns the syntax and semantic colors on or off. See Analysis. | |
| Flash Missing Braces | A missing brace flashes (twice a second) instead of being shown dimmed. See Analysis. | |
| Reset Layout | Shows the sidebar, Details and the message window again and puts them back at their first places and sizes, the sidebar at the left and the message window at the bottom (section 2). |
About the zoom. Ctrl+wheel in the editor zooms too, and Ctrl+middle click returns to the normal size. The zoom also applies to the formatted view of Markdown documents. It goes from 10 points smaller to 40 points larger (never below 4 points), the status bar shows the new size, and it lasts until Unryu quits. To change the font size for good, use Preferences > Interface > Interface > Fonts > Editor.
The same settings are also in Preferences > Editor > Display (line numbers, white space, line endings, indentation guides, markers margin, highlighting, flashing braces) and Preferences > Interface (toolbar, sidebar). All keys can be changed in Preferences > Keybindings; see Keyboard Shortcuts.
The minimap
View > Show Minimap (off at first) draws the whole document small, in a strip between the text and the scrollbar of each document: a pixel for each column and two for each line, in the colors Kami gives the text (with Syntax Highlighting on), spaces left out. The part of the document in sight is shaded. Click in the strip, or drag in it, and the view goes there, the line under the pointer in the middle. A document too long for the strip has a minimap that moves with the view, so the part in sight is always in it.
Lines that need you are marked at the minimap's right edge, and with a tick on the scrollbar's track where they are
in the whole document: errors and warnings of the last build (in the compiler error color), braces with no partner (in
the brace bad color), bookmarks, and the matches of Search > Mark. The minimap is 100 pixels wide; the
minimap-width key of unryu.conf takes 40 to 300.
Split window
View > Split Window puts a second view under the tabs, sharing the page with the document: beside it (Side by Side) or under it (Top and Bottom). Both are check boxes: check one to split that way (or to turn the split the other way), uncheck the checked one to close the split. Drag the bar between the two views to give one more room than the other. The split only arranges views; comparing two texts is the Compare menu's work.
The same document twice. The split starts with the document in front. The two views are then one document: what you type in either is in both, it has the typing help in both, and Undo and Redo (Ctrl+Z, Ctrl+Y) take back the document's last edit whichever view you are in. Each view scrolls on its own, so you can see two parts of a long file at once.
Another document beside it. Show name in the Split puts another open document in the split, to read,
copy from or edit beside the one in front. You can type in it: the edit goes into that document (its tab gets its
*), Undo and Redo there are that document's own, and Ctrl+S (File > Save) saves the
document you last clicked or typed in, so the one in the split saves without coming to the front. It has plain typing,
without Enter's indenting and the closing pairs, which only the document in front gets. It shows in its own language's
colors, made again a moment after each edit. When you bring another tab to the front, the split keeps showing what it
showed. Show This Document in the Split puts the document in front into the split again; Swap Sides brings the
split's document to the front and puts the one that was in front into the split. Closing the document the split shows
closes the split.
From the right-click menu. While the window is split (and not comparing), the right-click menu of either view has Split Top and Bottom (or Split Side by Side: the other layout), Show This Document in the Split (in the document in front, when the split shows another), Compare the Two Sides and Swap Sides (when the split shows another document), and Close the Split. These come before a misspelled word's suggestions.
Comparing two texts (the Compare menu)
Compare shows what differs between the document in front and another text, in the manner of Meld. The document in front is
the left side; the other text is the right side, in the split (Compare opens the split side by side when it
is not open). Unryu compares the two itself, line by line (it does not run the diff program): lines are
compared exactly, and a CRLF and an LF line end count as the same.
| Item | Keys | What it does |
|---|---|---|
| Compare with File on Disk | The document beside its file as it is saved: what you changed since the last save. | |
| Compare with Last Commit | The document beside its text in git's last commit (Git); outside a repository it reads Compare with Text as Opened, the text as it was when you opened it. | |
| Compare with name | The document beside another open document, one item for each. | |
| Next Change, Previous Change | Alt+Down, Alt+Up | The cursor to the next or previous change, in the side you last clicked or typed in; the other side lines up with it. The status bar says which change it is (Change 2 of 5). |
| Copy Change to Left, Copy Change to Right | Alt+Left, Alt+Right | The change at the cursor (or the next one after it) copied across: that side's lines replaced by the other side's, as one step that Undo takes back in the document that changed. |
| Copy All Changes to Left, to Right | That side made the same as the other, as one step Undo takes back. | |
| Swap Sides | The two documents change places; the comparison goes on. | |
| Stop Comparing | The colors, bands and change maps go away. A split that Compare opened closes; a split you opened yourself stays, showing the same two texts. | |
| One Scrollbar for Both Sides | A check box, on at first, and remembered. On: while comparing, only the right side (the bottom one, top and bottom) has a scrollbar, and it scrolls both sides. Off: each side has its own, and the two still scroll together. |
The Alt+arrow keys do this only while a comparison is showing; otherwise they keep their usual work (Alt+Left and Alt+Right Back and Forward, Alt+Up and Alt+Down scroll by a line). Preferences > Keybindings can give the Compare items other keys.
What you see.
- The changed lines are tinted in both sides in the editor theme's diff colors: lines only on the left (removed) in the color of a diff's deleted lines, lines only on the right (added) in the inserted color, and lines that are on both sides but differ (changed) in the changed color. Where lines are missing on one side, a small mark (▸ or ◂) shows where they would be.
- The changed characters. In changed lines, the characters that actually differ are tinted darker, so a one-letter
change (
getctofgetc) stands out. Lines that have almost nothing in common are left tinted as a whole, and a changed block longer than 20,000 characters is not compared character by character. - The bands. Side by side, the bar between the two views widens into a strip that joins each change's lines on the left to its lines on the right with a band in the change's color, so you can see which lines go with which even where one side has more lines than the other. The current change (the one at the cursor) has a brighter band with a thicker edge. You can still drag the strip to share the page differently. Top and bottom, there are no bands: the colors and the change maps still show.
- The arrows. Each band has an arrow at each end. The arrow at the left end (▶) copies the change to the right side, the one at the right end (◀) copies it to the left side. Under the pointer an arrow lights up and the status bar says what a click does. An arrow is left out where that side cannot change: a file on disk or a commit on the right can only be read, and so can a document set to Read Only.
- The change map on the scrollbar. While comparing, the scrollbar's track shows every change in the whole text, in its color, and the thumb is a frame round the part in sight, so the changes under it still show. Drag the frame to scroll, or click or drag anywhere else on the track to go there. A text shorter than the view is drawn as its lines are on screen, so its marks sit level with its lines. With One Scrollbar for Both Sides (the default) the left side has no scrollbar while comparing: the right side's scrolls both, and the wheel and the keys still scroll either side.
Editing while comparing. Both sides can be edited when the right side is a document (a file on disk or a commit can only be read). The comparison is made again shortly after each edit, at most twice a second. The two views scroll together: the line that goes with the first line of one is at the top of the other.
Another tab in front. A comparison belongs to the document that was in front when it started. Bring another tab to the front and the comparison waits: the split stays, without colors. Bring the document back and the comparison comes back with it. Closing either document ends it.
From the right-click menu. While comparing, the right-click menu of either side has Copy This Change to the Right and Copy This Change to the Left (the change under the click, or the next one after it), Next Change and Previous Change (from that side), Swap Sides and Stop Comparing.
11. A Markdown document in the editor
A Markdown document opens in a formatted, editable view (what you see is what you get), with a formatting toolbar above it. The file itself stays Markdown: your edits are written back into it as Markdown shortly after you stop typing, and before a save, a print or a build. A file you only read is never rewritten.
The formatting toolbar has buttons for Bold (Ctrl+B), Italic (Ctrl+I), Underline,
Strikethrough, Superscript, Subscript, Inline Code, Highlight, Foreground Color, Background Color, Heading 1 to 6, Bullet List,
Numbered List, To-do List, Block Quote, Horizontal Rule, Insert Image, Insert Link, Code Block, Insert Table, Insert Footnote,
Inline Math, Display Math Block, the Note, Tip, Important, Warning and Caution admonitions, Indent, Outdent, Undo
(Ctrl+Z), Redo (Ctrl+Y) and Plain Text. Its icons are symbolic: one color, the
toolbar's text color, from the icon theme's symbolic icons, else Adwaita's, else Unryu's own, so the bar reads as one
set under any theme (no theme has icons for all its buttons; none has headings). The color buttons open the Color Chooser;
Insert Image asks for a file; Insert Link asks for an address or a file for the selected text. A click on a link in the formatted
view opens its file, its heading or its web address. On a block that is already a heading, a list or an admonition, choosing
another heading level, list kind or admonition changes the block to it; choosing the same one again makes it a plain
paragraph. The admonitions are written as GitHub's alerts (> [!NOTE]). A dollar sign before a number, as in
"$5", is plain text, not the start of math.
The buttons are in groups, and each group has a grip at its left. Drag the grip to move the group to another place or another row. The arrangement lasts only while the document is open.
Plain Text switches to the Markdown source, shown in the normal editor with all of Unryu's editing help; click it again for the formatted view. Unryu keeps your place when you switch: the cursor and the line at the top of the view stay on the same text, in both directions. A click on a heading in the Symbols list puts that heading at the top of the formatted view. Unryu remembers which view each document showed, and shows it again at the next start.
Tables in the formatted view have as many rows and columns as in the source, each cell shows all its text with its formatting (bold, italic, code, links, strikethrough, highlight ...), each column is as wide as its text, and a table wider than the editor scrolls across.
- Click in a cell to put the cursor there; the arrow keys also enter a table from the line before or after it. Type, select, copy and paste in the cell. Tab, Shift+Tab, Enter and the arrow keys go from cell to cell.
- Dragging, or Shift with the arrow keys, selects across cells. A selection of the document includes each table it crosses. Ctrl+A selects the whole document.
- Format text in a cell as anywhere else: select it, then Ctrl+B, Ctrl+I, Ctrl+U or a text style of the toolbar. Text you type takes the formatting of where it goes. A click on a link in a cell follows it.
- Copying from the formatted view gives Markdown, tables included, as plain text. A copy from inside one cell keeps its formatting, and a paste into a cell brings the formatting with it (on one line: a cell has no line ends).
- A cell you did not edit is written back exactly as it was. A cell you edited is written from its text and its formatting
(
**bold**, a link, code ...), with a|in it escaped. - To add or remove rows and columns, use Plain Text.
12. The window's size and place
Unryu remembers the size and the place of its window when it quits, and opens it the same way next time, maximized if it was
maximized. They are kept in ~/.config/unryu/window.txt as "x y width height maximized".
- The place is that of the window manager's frame, so the window comes back exactly where it was, not one title bar lower each time.
- For a maximized window, Unryu keeps the size it had before it was maximized, so that un-maximizing gives that size back.
- If the saved place is no longer on the screen (for example, a monitor was removed), the window manager places the window instead. A saved size larger than the screen is made to fit.
- Fullscreen is not remembered, and the size of the screen is never saved as the size of the window.
- Preferences > General > Startup > "Save window size" and "Save window position" turn each part off (both are on at first). The window then opens at 1400 × 900, where the window manager puts it.
13. Starting Unryu again: one window, or a second one
Normally there is one Unryu window on a display. When you start Unryu while it is already running (from a terminal, a file manager or a desktop launcher):
- With files (
unryu a.c b.h), the running Unryu opens them, each in its own tab, and comes to the front. The new start then ends. Relative names are taken from the folder you started in. - Without files, the running Unryu just comes to the front.
- If the running Unryu has a dialog open, the files wait until it is closed.
To get a second window:
- Start Unryu with
-ior--new-instance. It opens its own window, with the files you name. Later starts do not hand their files to it; they go to the first Unryu. - Or turn on Preferences > General > Startup > "Open a new window when Unryu already runs". Starting Unryu without files then opens a new window. Starting it with files still hands them to the running window, so that files from a file manager all go into one window.
A second window that starts while another Unryu is running begins with an empty document. It does not open the files of the last session, and it does not save its own tabs as the session: the session belongs to the first window. Its panel layout and its window size and place are saved when it quits, as the first window's are: the window that quits last decides how the next start looks.
14. The menus
An overview of the menu bar. Click a title to open its menu, or press Alt and the title's first letter (Alt+F File, Alt+E Edit, Alt+S Search, Alt+N Navigate, Alt+V View, Alt+D Document, Alt+C Compare, Alt+B Build, Alt+T Tools, Alt+H Help). In an open menu, Up and Down choose an item, Enter runs it, Left and Right go to the next menu, and Escape closes it. A menu item shows its keys at the right, including keys you changed in Preferences > Keybindings. An item is greyed while it cannot be used (for example, Recent Files when there are none).
| Menu | What it holds |
|---|---|
| File | New, New (with Template), Open, Open Selected File, Recent Files, Recent Projects, Workbench, Save, Save As, Save All, Reload, Reload As, Properties, Page Setup, Print, Close, Close Other Documents, Close All, Quit. See Files and Recovery. |
| Edit | Undo, Redo, Cut, Copy, Paste, Delete, Select All, Commands, Format, Insert Comments, Insert Date, Insert "include <...>", Insert Alternative White Space, Insert Placeholder Text, Insert Unicode Character, Preferences. See Editing and Preferences. |
| Search | Find, Find Next, Find Previous, Find in Files, Stop Find in Files, Replace, Next Message, Previous Message, Go to Next Marker, Go to Previous Marker, Go to Line, More, Clear Marks. See Find and Replace. |
| Navigate | Back, Forward, Go to Anything, Command Palette, Go to Symbol in the Project, Switch Header and Source, Go to Partner, Select Inside Pair, Select Pair, Go to Definition, Next Doubtful Brace, Previous Doubtful Brace, Insert Missing Brace, Suggest Repairs (Runs the Compiler). See Editing and Analysis. |
| View | See section 10 of this page, and Themes. |
| Document | The active document's settings (Line Wrapping, Line Breaking, Auto-indentation, Indent Type, Indent Width, Read Only, Write Unicode BOM, Set Filetype, Set Encoding, Set Line Endings), Clone, Strip Trailing Spaces, Replace Tabs with Spaces, Replace Spaces with Tabs, Fold All, Unfold All, Remove Markers, Remove Error Indicators. See Editing. |
| Compare | Compare with File on Disk, Compare with Last Commit, Compare with each open document, Next Change, Previous Change, Copy Change to Left, Copy Change to Right, Copy All Changes to Left, Copy All Changes to Right, Swap Sides, Stop Comparing. See Comparing two texts (section 10). |
| Debug | Start, Pause, Stop, Step Over, Step Into, Step Out, Run to Cursor, Toggle Breakpoint, Remove All Breakpoints, Add Watch, Set Target. See Debugging. |
| Build | The build commands (Compile, Build, Make, Execute and the others) and Set Build Commands. See Build and Run. |
| Tools | Reload Configuration and Configuration Files (see Preferences); Code Tools (checkers, formatters and git: see Build and Run); Macros (see Editing); Color Chooser and Word Count (below); Check Spelling and Spelling Word List... (see Editing); Translation, the Translation Helper for gettext catalogs (see Editing); Git (see Git); Set Project Folder, No Project for This Folder, Find Project Again, Save Project Settings in Folder, Approve Project Build Commands (see Build and Run). |
| Help | See below. |
The editor's own right-click menu (Cut, Copy, Paste, Select All, Undo, Redo, Context Action) is described in Editing.
The Help menu
| Item | What it does |
|---|---|
| Help (F1) | Opens this manual's first page in your browser: the browser command of Preferences > Tools (at first
xdg-open, the desktop's own browser). If the manual is not installed beside the program, the status bar says so. |
| Look Up Documentation (Shift+F1) | The documentation of the name at the cursor, in Details (below). |
| Keyboard Shortcuts | Shows every key, by group, in Details (and shows Details if it was hidden). Keys you changed in Preferences > Keybindings are listed at the end. See also Keyboard Shortcuts. |
| Debug Messages | Shows in Details what Unryu reported while it ran (its start, errors from the window system), the last 200, each with its time (and shows Details if it was hidden). Unryu also writes them to its standard error. |
| Colors | Explains in Details what the colors of braces and names mean, and where to change them (and shows Details if it was hidden). |
| Compiler | Explains in Details when Unryu runs a compiler (only for Suggest Repairs and the popup's "ask the compiler" link), what it may do, and which compiler it uses (and shows Details if it was hidden). |
| About | The version of Unryu and of the parts it is built on, and its license. |
Help > Look Up Documentation
Look Up Documentation (Shift+F1) gives the name at the cursor, or the selection, to the
language's own documentation program, and shows what it prints in Details (and shows Details if it was hidden). The
name may have dots and :: in it (os.path.join, std::vector); it must be a name,
not starting with - or .. The programs are:
| Language | Command |
|---|---|
| C | man -S 3:3p:2:7: the library's pages first, then the system calls |
| C++ | man -S 3:3cxx:3p:2:7 |
| Shell, Makefile | man, the commands' pages |
| Tcl | man -S 3tcl:n:3 |
| Python, Cython | pydoc3 |
| Perl | perldoc -T -f (the perl-doc package) |
| Go | go doc |
| Ruby | ri |
For another language, or another command, add a line to documentation.conf (Tools > Configuration Files):
Lua = luadoc %s, with %s for the name. A line there comes before the built-in command.
A man page shows as it does in a terminal: its bold and underlined words drawn bold and underlined, its lines and indentation kept. If the program finds nothing, Details says so above what it printed.
Safety. A documentation program can run code: pydoc3 imports the module, which runs it. So the
program runs in a jail, as the compiler does (Safety): it may read and run the system's folders,
read /etc and the folder of the file in front, and write nothing. It runs without a shell (the command is
split at its spaces), in a session of its own, with no home folder and a set environment, and it is stopped after 10
seconds or 2 MB of output. Where the jail cannot be made, it does not run.
Tools > Color Chooser and Word Count
Color Chooser (also the toolbar's Color Chooser button) opens a color picker. If the cursor is on a color code such as
#3a7, #33aa77 or 0x33aa77 (or you selected one), the picker starts with that color, and
OK replaces the code with the color you choose. Otherwise OK inserts the color at the cursor. The picker's Format row chooses how the
color is written (#RRGGBB at first, or another code format); Unryu remembers that choice, even when you cancel. Cancel,
Escape or closing the window changes nothing.
Word Count shows the number of lines, words and characters of the selection, or of the whole document when nothing is selected.
An error from the window system never stops Unryu, so unsaved text is not lost. Unryu notes the error in Help > Debug Messages and goes on. If the connection to the display is lost (usually at a logout), Unryu first writes recovery copies of unsaved text (see Files and Recovery).