385 Commits

Author SHA1 Message Date
Colomban Wendling
deede0595e Fix notebook tab switching with keyboard if some pages are hidden
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.
2013-05-10 00:10:46 +02:00
Eugene Arshinov
cc5e6d2a19 rewrite_reflow: Reimplement split_line function to achieve consistency with the "Line breaking" option 2013-04-21 11:45:09 +10:00
Eugene Arshinov
390646a412 rewrite_reflow: Extract split_line function
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.
2013-04-21 11:45:09 +10:00
Colomban Wendling
35cc441b74 Merge branch 'gtk3-support'
Conflicts:
	src/ui_utils.c
2013-03-10 17:20:25 +01:00
Colomban Wendling
dba93f3854 Allow Quit keybinding to be configured
This removes the last unmodifiable keybinding relying on GTK's
defaults, and allows somebody to change this keybinding.
2013-02-21 01:31:38 +01:00
Colomban Wendling
a0dc8af9c4 Fix GTK default keybindings being still active after being unbound
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.
2013-02-21 01:31:38 +01:00
Colomban Wendling
8ece89096d Merge branch 'master' into gtk3-support 2013-01-29 15:29:10 +01:00
Nick Treleaven
6ca889c78b Add Document->Clone keybinding 2012-12-12 14:02:50 +00:00
Nick Treleaven
0b63957e59 Add 'Move Line(s)' menu items in Edit->Commands (and popup menu)
Although using menu items for these is not very practical, it helps
discoverability, and they're more useful and intuitive than 'Transpose
Current Line'.
2012-11-23 16:30:18 +00:00
Nick Treleaven
3cfd8fa8b1 Clear search markers on Mark All keybinding when already set 2012-10-26 14:37:31 +01:00
Colomban Wendling
c5985f0cd1 Add ::draw handler for GTK3 where we have ::expose-event handlers 2012-10-08 20:08:07 +02:00
Colomban Wendling
a763e307f7 Don't access GtkWidget fields directly
Since many accessor are new in GTK versions we don't depend on, add
a header that defines them to the direct access if they aren't
available.
2012-10-08 20:08:06 +02:00
Colomban Wendling
d80bc7ce56 Update FSF address
Closes #3557875.
2012-08-24 19:25:57 +02:00
Matthew Brush
e62bec43fc Use g_build_filename() instead of g_strconcat() for paths 2012-08-09 18:21:43 -07:00
Nick Treleaven
40da14b5b1 Add keybinding for 'Go to Start of Display Line' (#3182425) 2012-06-25 14:31:36 +01:00
Colomban Wendling
1c2c455b1d Update copyright information 2012-06-18 01:15:04 +02:00
Frank Lanitz
304f3a8b47 Adding a small note pointing out that setting a default keybinding might not the best idea for plugin maintainers 2012-06-04 16:19:11 +10:00
Nick Treleaven
6286b288a4 Fix always showing Save All keybinding as overridden
Defaults should use lowercase e.g. GDK_s, not GDK_S.
2012-04-04 13:43:41 +01:00
Nick Treleaven
9e418d7aaf Show overridden keybindings in bold for prefs dialog tree 2012-04-04 13:43:39 +01:00
Nick Treleaven
ec3efe0486 Fix existing user's goto tag/move tab workaround (oops)
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.
2012-03-20 12:59:29 +00:00
Nick Treleaven
99e8ed495b Don't change existing user's goto tag, move tab keybindings
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.
2012-03-19 16:52:38 +00:00
Eugene Arshinov
f8fd93039b join_lines: Remove excessive comments 2012-02-25 19:55:24 +04:00
Eugene Arshinov
2d29296302 join_lines: Remove sci_fix_selection_anchors function.
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.
2012-02-25 19:51:32 +04:00
Eugene Arshinov
f318b2cca0 join_lines: Remove some obsolete code from reflow_lines.
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.
2012-02-25 19:48:37 +04:00
Eugene Arshinov
1816b0d7f4 join_lines: Don't exclude trailing newline from the selection in reflow_lines
This is now done by the calling code.
2012-02-25 19:48:07 +04:00
Eugene Arshinov
6b760b99d4 join_lines: Add "Join lines" command.
The code of existing "Reflow paragraph" command was refactored to
extract the bits required for the new command.
2012-02-25 19:48:07 +04:00
Eugene Arshinov
f5262a453e Use Scintilla's MOVESELECTEDLINES{UP,DOWN} commands. 2012-02-20 19:58:13 +01:00
Nick Treleaven
b287553e4a Use 'SETPTR' instead of 'setptr'
This makes it clearer we're using a macro.
2012-01-25 16:26:16 +00:00
Nick Treleaven
ed66c2b293 Remove LW() macro 2012-01-25 13:46:31 +00:00
Nick Treleaven
5288dbe5d3 Add Project New, Close keybindings 2012-01-09 16:35:29 +00:00
Nick Treleaven
eb04c514ba Add API function ui_lookup_stock_label()
Using this can avoid adding i18n strings unnecessarily.
2012-01-08 17:37:58 +00:00
Nick Treleaven
8f44132dcd Add 'Open Project' keybinding 2012-01-08 17:14:04 +00:00
Colomban Wendling
804de2572e Properly include notebook.h for notebook_switch_tablastused() declaration 2011-12-26 16:04:52 +01:00
Jiří Techet
ddbb2535f4 Move MRU tab handing from keybindings.c to notebook.c because this is where it belongs 2011-12-24 12:31:10 +01:00
Colomban Wendling
23eede5291 Make switch to MRU upon tab close configurable
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.
2011-12-24 12:30:58 +01:00
Jiří Techet
f6be8b47d7 Make the tab switching dialog a bit more useful
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.
2011-12-24 12:30:01 +01:00
Jiří Techet
0acb273c55 Rewrite tab switching queue
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>
2011-12-24 12:29:51 +01:00
Jiří Techet
d0892b95d1 When closing tab, return to the document at the top of the MRU list
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>
2011-12-24 12:29:43 +01:00
Matthew Brush
906ffc6aae Fix some widget names in glade file and code so they match (oops) 2011-12-10 14:10:44 -08:00
Matthew Brush
088b0bc362 Merge branch 'master' into gtkbuilder
Conflicts:
	geany.glade
	src/Makefile.am
	src/callbacks.c
2011-12-05 20:52:00 -08:00
Nick Treleaven
9ae71ab6cc Add default keybindings for Go to Tag, remove Transpose default
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.
2011-11-17 15:58:27 +00:00
Nick Treleaven
82769a046c Set Move Line(s) default keybindings, change Move Tab defaults
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.
2011-11-17 15:49:09 +00:00
Nick Treleaven
a97c3597eb Add default shortcuts for Find Usage, Forward/Back, Make Object
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
2011-11-15 13:50:29 +00:00
Matthew Brush
9bffb94cc4 Real-time type keyword highlighting
* 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().
2011-11-11 16:08:26 -08:00
Matthew Brush
0a16ec7520 Merge branch 'master' into gtkbuilder
Conflicts:
	src/interface.c
	src/vte.c
2011-11-06 23:44:24 -08:00
Matthew Brush
c9a32bfdc9 Make use of gtk_widget_get_window() added in GTK+ 2.14 2011-11-06 18:25:48 -08:00
Colomban Wendling
0167f589b3 Small code cleanup
Use foreach_document() in a few places where appropriate and make
some code more consistent.
2011-11-03 19:22:40 +01:00
Matthew Brush
2a5164f098 Change some widget names that were changed in the Glade 3 file. 2011-10-10 13:16:58 -07:00
Colomban Wendling
d06e9f4575 Remove $Id$ and $Date$ SVN keywords 2011-10-09 22:57:35 +02:00
Nick Treleaven
1563c625f7 Add document_show_tab().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@6017 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-10-07 16:47:31 +00:00