363 Commits

Author SHA1 Message Date
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
Nick Treleaven
abefcc3375 Support visual reordering of keybinding groups without breaking the
plugin ABI.
Reorder Project group to follow main menu order.
Move Focus, Notebook tab groups last as they don't have 
corresponding menu items.
Use keybindings_get_core_group() for fixed group IDs instead of 
indexing keybinding_groups.
Make keybindings_lookup_item() only work with a GEANY_KEY_GROUP_ 
ID, not an index into keybinding_groups.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5990 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-10-03 14:57:02 +00:00
Colomban Wendling
fc6dc88772 Fix search for the current word if it isn't composed of only GEANY_WORDCHARS
Use Scintilla's definition of a "word" when fetching the current word
to perform a search.  This is needed when we perform a whole-word
search for Scintilla to find the matches.

Closes #3386129.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5895 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-08-21 17:15:19 +00:00
Colomban Wendling
ddb4ad5fa5 Fix some whitespace style errors
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5886 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-08-06 18:34:14 +00:00
Colomban Wendling
edc8457e8a Cleanup GeanyWrapLabel a bit
* Do all mandatory initializations in _init() rather than _new();
 * Drop geany_wrap_label_set_text() in favor of plain
   gtk_label_set_text(), making the widget a little simpler and more
   transparent to the caller.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5795 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-05-10 23:51:01 +00:00
Nick Treleaven
ac11289415 Fix Ctrl-Shift-[CV] keybindings to work outside the VTE.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5722 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-04-13 15:04:37 +00:00
Colomban Wendling
a788a38240 Revert "Don't update parent WorkObjects when updating one in real-time"
This reverts commit 877cc1d97acd185cc7e0e88bb0b014fb74e16072.

This commit broke calltips, we need another fix for it.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5711 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-04-11 15:54:43 +00:00
Colomban Wendling
8640d845d0 Don't update parent WorkObjects when updating one in real-time
Updating the parent may lead to performance issues if an object have
too many parents since they are updated recursively.

Parent objects are still updated when saving the file.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5642 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-28 20:36:06 +00:00
Enrico Tröger
b235ae2f7e Add new keybinding 'Remove Markers and Error Indicators'.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5641 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-27 16:05:00 +00:00
Colomban Wendling
dbb260f5bb Fix some compiler warnings
* Shadowed function (splitwindow plugin);
 * Invalid escape sequence (classbuilder plugin);
 * Non-static local functions (classbuilder plugin);
 * Missing function argument type (keybindings.c).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5626 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-24 22:00:34 +00:00
Nick Treleaven
ff7d6b9cad Make VTE copy/paste shortcuts work if 'Override Geany
keybindings' is not set.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5624 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-24 17:59:05 +00:00
Nick Treleaven
e3d3765ae6 Add fixed shortcuts for VTE copy (Ctrl-Shift-C) and paste
(Ctrl-Shift-V).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5623 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-24 17:33:47 +00:00
Enrico Tröger
6ac2623208 Update copyright information.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5528 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-01-19 19:39:09 +00:00
Nick Treleaven
6c30fc692f Add Edit->Insert Alternative White Space menu item (was previously
removed from Edit->Commands submenu).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5498 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-12-24 13:31:39 +00:00
Nick Treleaven
d65d3adcc4 Fix segfaults when using 'Send Selection to Terminal' and the VTE
is not loaded, and when using Ctrl-A after enabling the 'Load VTE'
pref (patch by Dimitar Zhekov, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5470 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-12-07 13:02:46 +00:00
Nick Treleaven
ff6354d833 Remove unnecessary 'global' from long line editor pref field names.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5432 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-23 17:36:29 +00:00
Nick Treleaven
a29d75af2c Add editor_get_prefs() instead of editor_get_long_line_*()
functions. This general function can be extended to support
various project and document overrides.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5431 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-23 17:25:58 +00:00
Nick Treleaven
47372d9331 Add 'Mark All' Search menu command.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5427 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-23 12:50:24 +00:00
Nick Treleaven
cb9982480f Make Reflow Lines/Block command use the current indented block, not
the whole paragraph, which could have mixed indentation.
Fix memory leak and off-by-one bug on first line when using Select
Paragraph command.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5408 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-16 13:26:04 +00:00
Nick Treleaven
3b7c8cdeb0 Restore top-level editor popup item 'Find Document Usage'.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5382 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-08 12:35:50 +00:00
Nick Treleaven
98489fed51 Fix Alt+[0-9] switching tabs when other modifiers are also held.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5355 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-02 15:03:16 +00:00
Nick Treleaven
9e1ff83085 Add 'Insert New Line Before/After Current' keybindings (based on
patch by Eugene Arshinov, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5297 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-10-15 17:15:13 +00:00
Nick Treleaven
acd07db9c1 Move 'Edit->Commands->Insert Alternative White Space' to editor popup
Insert menu.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5255 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-09-23 14:32:32 +00:00