Buffer Sets and closing buffers

The Buffer Sets feature helps keep the buffer lists local and manageable when using jEdit in a multiple-View and multiple-EditPane environment.

As mentioned in the previous section, each Edit Pane can show a Buffer Switcher, which displays the contents of a Buffer Set. In jEdit 4.2, all EditPane buffer switchers showed the same BufferSet: a global list of all buffers that were opened from any EditPane in any View. When using many Views and EditPanes, this resulted in large lists of buffers, and made the next/previous buffer actions useless with many Views, EditPanes and Buffers.

Since jEdit 4.3, it is possible to have more narrow scopes for the Buffer Sets of an Edit Pane. This makes the 'next-buffer' and 'previous-buffer' actions switch between buffers that are local to the view or pane.

The three BufferSet scopes are:

  1. Global: Includes all buffers open from any EditPane.

  2. View: EditPanes in the same View share the same BufferSet. Opening a buffer in one View will not affect the other views.

  3. EditPane: Each EditPane can have its own independent BufferSet.

File > Close removes the current buffer from the EditPane's BufferSet only. If it was the last BufferSet to contain that buffer, the buffer is also closed.

The File > Close (global) action closes the buffer in all EditPanes, as the jEdit 4.2 File > Close action did before.

When Exclusive Buffersets 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.

Close Others will clear the BufferSet of the current EditPane by performing a Close on all items except those buffers which are displayed in another active EditPane.

Switching Bufferset Scopes

Bufferset Scope can be set from Utilities >Options > View > BufferSet scope:.

The statusbar shows you which BufferSet scope is active (look for the letter "G", "E" or "V"). Double-clicking on that will allow you to change the scope without going into global options.

The BufferSet Scope can also be changed from View>Buffer Sets > (Global|View|EditPane) Buffer Set. A change to the bufferset scope affects all editpanes immediately.

Sorting of Buffer Sets and Buffer Switchers

Buffer Switchers and Buffer Sets can be sorted independently. Both can be sorted by name or by path. Both can be left unsorted. Possibly the most useful combination is to sort the Buffer Switchers and leave the Buffer Sets unsorted. In this case, it is easy to find the buffer to work with in the Buffer Switcher since the buffer names are sorted alphabetically, and leaving the Buffer Set unsorted means the "go to previous" and "go to next" actions follow the order in which the buffers were last used rather than by name. However, some users prefer Buffer Sets to also be sorted by name or path, so jEdit supports multiple sorting methods.