When switching the current notebook tab, we need to take only visible
pages into account. If we don't and we try switching to an invisible
page, nothing happens.
In practice, the issue is visible on the message window notebook if one
of the tabs are hidden due to one of the "msgwin_*_visible" settings.
Extract `split_line` function from `reflow_lines` to reimplement it in
the future without using SCI_SPLITLINES to achieve the
behaviour consistent with the "Line breaking" option.
If we provide an AccelGroup when creating a menu item using a sock ID,
it installs the GTK default accelerator, accelerator we can't remove
since we don't know about it. So, don't give an AccelGroup so GTK
don't install it's own accelerator.
This fix also required to properly update the accelerator on some item
we used to ignore since the update didn't work anyway (since the GTK
accelerator was displayed instead).
Note that this doesn't fix the fact the editor popup menu accelerators
are never updated after startup so they don't get updated before
restart after changing a keybinding in the preferences. This is a
separate (and less problematic) issue due to a simple lack of update.
Closes#1912683 and #3599251.
Although using menu items for these is not very practical, it helps
discoverability, and they're more useful and intuitive than 'Transpose
Current Line'.
Write an empty keybindings.conf for new users to prevent the workaround
for old defaults being written.
Also remove generated comment in keybindings.conf, this file doesn't
need an explanation as it is generated by Geany.
This provides a workaround so existing users who upgrade should now
be unaffected.
The default changed for these in commits
82769a046c6394d073cc8a32677d8d4794c12c4c and
9ae71ab6cc3bb8185939e1536ffba41beb896686, but this may be
confusing/annoying for existing users who have not edited any
keybindings.
Those commit messages were wrong about never affecting existing
users. Thanks to Lex for raising this.
Previously it was useful because `reflow_lines`, in case when selection
contained trailing newline, removed that newline from selection by
calling `sci_set_selection_end` which only works when anchor > current
cursor position (it's mentioned in Scintilla's documentation on
SCI_SETSELECTIONEND).
Now trailing newline is removed by calling `sci_deselect_last_newline`
which uses `sci_set_selection` with `start` and `end` arguments. This
function works regardless of the interposition of current cursor
position and anchor.
The code joined current line with the next one when no text is selected.
For "Join lines" command this behaviour is wrong; for "Reflow paragraph"
the case is already handled outside the `reflow_lines` function.
Add configuration option tab_close_switch_to_mru to allow the user
to choose whether to switch to the most recently used tab or to the
next one after closing the current tab.
Right now the tab switching dialog shows the full
path of the current file. However this dialog is too
narrow and in my case usually displays one directory
per line. This makes it hard to find the base
filename, which is the thing you are most probably
looking for.
This patch displays only the base name - in bold. In
addition, it displays the following three filenames
in the MRU list, each on a new line (not in bold).
This helps to see what file comes next and how many
times one has to press ctrl+tab.
There was one more bug related to the tab switching. When we switch
so many times that we return back to the original document (so we
actually don't switch at all) then the following switch attempt
doesn't switch immediately to the next document.
After spending two hours thinking what is wrong, I gave up and rewrote
the whole thing in a different way. The problem with the previous
implementation was that before you couldn't just look what's in the queue
"now" - you had to imagine what will be inserted there in the next step
because the switch_in_progress variable was set after the first switch
(this is also why I put the long comment why mru_pos = 2 - that is not
clear at all when you first look at it). Also there were some not very
nice "workarounds" like the idle function that was executed after the
switch and removed the double entry on top of the queue.
So with the new implementation things are much simpler IMO. The queue
starts with the current document and the previously opened documments
follow. It's *always* like that, no exceptions. The idle function
is gone and cb_func_switch_tablastused() is simplified too. The rest of
the functionality should be clear from the code.
Signed-off-by: Jiří Techet <techet@gmail.com>
This is a pretty frequent work pattern of mine:
1. Editing file A
2. Searching for function and opening file B
3. Closing file B because I just wanted to look at the function definition
4. Without this patch I get to the file following the B's tab (which
is just a random file) but my brain expects that I get to A
I know it's possible to kind of simulate the behaviour I want with
the "next to current" placement option but I really don't see a single
advantage of having tabs closed in sequential order. This is also
why I didn't make this behaviour optional. But maybe I miss some
use case of tabs being closed sequentially - just tell me.
Signed-off-by: Jiří Techet <techet@gmail.com>
This does not affect existing users.
Ctrl-T Go to tag definition
Ctrl-Shift-T Go to tag declaration
A default keybinding for 'Transpose current line' is no longer
necessary as it does the same as 'Move line(s) up', which we now have
a default for.
This does not affect existing users.
Ctrl-Shift-PageUp Move document left
Ctrl-Shift-PageDown Move document right
The above shortcuts were aliases for selecting left/rightmost
documents, but those are not necessary as Alt-1/Alt-0 does the same.
Alt-PageUp Move line(s) up
Alt-PageDown Move line(s) down
Alt is easier to press than Ctrl-Shift, so is better for moving lines
as this needs more accuracy.
Note: This doesn't affect existing user shortcuts.
Ctrl-Shift-D Find Document Usage
Ctrl-Shift-E Find [Session] Usage (one letter after doc usage and
close on the keyboard)
These are standard shortcuts for browsers:
Alt-Right Forward
Alt-Left Back
This matches the build/make symmetry for compile (F8):
Shift-F8 Make Object
* Add new function: document_update_tags().
* Refactor the various tag update functions into document_update_tags().
* Remove extra call to update the tags in document_new_file().