Commit Graph

537 Commits

Author SHA1 Message Date
Kornel Benko
9ee515c984 Amend 154b4fde 2018-12-26 17:45:34 +01:00
Juergen Spitzmueller
154b4fdece Give textstyle-apply a history
The last 20 applications are saved now and accessible both via the lfun
(textstyle-apply n) and the toolbar (via button menu)

Fixes: #7133

This also changes the default icon and toolbar position of the action,
as requested in #11427
2018-12-26 15:46:14 +01:00
Kornel Benko
06c05430d9 FindAdv: Added lyx-function search-ignore
Enable/disable ignoring the specified type
	language: e.g. british, slovak, latin, ...
	color:	blue, red, ...
	sectioning: part, chapter, ..
	font:
		series: bold, ...
		shape: upright, italic, slanted
		family: serif, monospace ...
	markup: enphasize, noun
	underline:
	strike:

Examples:
	search-ignore language true
	search-ignore shape true
2018-11-15 14:20:50 +01:00
Juergen Spitzmueller
4648f39a1e info-insert without arg is valid
it opens the info dialog.
2018-09-20 11:11:44 +02:00
Juergen Spitzmueller
92bfa07a62 Avoid infinite loop
Fixes: #11295
2018-09-19 10:19:19 +02:00
Juergen Spitzmueller
ed61ce74b7 So long, date-insert!
This function is superseded by info-insert date, which is much mightier
and more flexible.
2018-08-20 09:25:22 +02:00
Juergen Spitzmueller
b0f579655c InsetInfo: Move validateArgument() to params
and use it for LFUN_INFO_INSERT validation
2018-08-18 14:29:15 +02:00
Juergen Spitzmueller
307319e95e Introduce InsetInfoParams
This allows to open the dialog without having an inset already.
2018-08-06 20:07:15 +02:00
Juergen Spitzmueller
e730234e57 Add date-related info insets
With this commit, info insets leave the dark backstage room of an opaque
and quite hidden dev-only feature and come frontstage.

In the UI, they present themselves as "Fields" since this is what people
know from word processors. Other user-related fields that could be
implemented next: time, user name (I plan to do that for 2.4).

Since this supersedes date-insert, I removed Insert > Date from
the menu and propose to ditch date-insert and the corresponding rc.

The lyx2lyx reversion routine has lots of room for improvement and
attractive tasks for pythons (file timestamp, switch of localization).
Please feel invited!

This is a file format change.
2018-08-05 10:01:36 +02:00
Scott Kostyshak
d12798759a Fix crash when selecting text with changes
When selecting text, in some cases a DocIterator could be forwarded
to a (non-existant) paragraph after the end. The critical part of
this fix is to break the loop at the correct place. The following
are additional improvements:

- increase readability by defining a bool named "in_last_par"
- use cur.selectionEnd().pit() instead of cur.selectionEnd().paragraph().id()
- use it.lastpos() instead of it.paragraph().size()

This commit fixes a regression introduced by 23de5e5e, and reported
at #11204.

Thanks to Jürgen and JMarc.
2018-07-27 15:39:39 -04:00
Juergen Spitzmueller
803a88f243 Sort out problems with InsetInfo language settings
* use the context language of the info inset (rather than the buffer
language), and translate strings accordingly

* for menu and shortcuts, use the Gui language instead

* actually care that all translatable strings end in po
(this wasn't the case).

Fixes: #5348, rest of #10463
2018-07-27 12:14:37 +02:00
Jean-Marc Lasgouttes
e4dba53232 Do not remove character at start of paragraph when cutting
The part of code that removed space at start of paragraph have been
there forever, but its intent is unclear. For example, cutting text at
the end of a paragraph will lead to remove space at the start of this
same paragraph.

The removal of this functionality is offset by a rewrite of DEPM that
makes it more thorough.

Fixes bug #10503.
2018-07-22 23:20:21 +02:00
Jean-Marc Lasgouttes
ad5548cfe3 Fixes to input method handling
The goal of this patch is to make "self-insert <string>" act as a
sequence of individual self-insert calls. Once it is done, the
insertion of the commit string in GuiWorkArea can use that, which
fixes the issues described in bug 11183.

1/ in InsetMathNest, SELF_INSERT is rewritten to be a proper loop of
   interpretChar, instead of inserting the string as characters. This
   solves the issue of interpreting ^ properly.

2/ the text version does not need to be changed (the loop is rewritten
   using a range, though).

3/ Then {{{GuiWorkArea::inputMethodEvent}}} is changed to invoke
   directly self-insert. This removes the update issues.

Fixes bug 11183.
2018-07-05 14:32:37 +02:00
Jean-Marc Lasgouttes
3591aa833f Implement layout-toggle lfun
This is like `layout', except that the layout is reset to default if
it was already correct. In the case of a selection, the layout is set
normally if some layouts in the selection are not at the required
layout; it is reset only if all the layouts of the selection already
have the required layout.

Part of ticket #9864.
2018-05-15 00:03:55 +02:00
Jean-Marc Lasgouttes
255a5cf401 Clean up code of LFUN_LAYOUT
Factor out some code in helper functions. Improve getStatus so that
icon is selected only when the whole selection has the correct layout.

This work towards ticket #9864.
2018-05-14 16:45:46 +02:00
Scott Kostyshak
23de5e5e19 Only show Accept/Reject Change options if relevant
In the context menu for a selection, we now only show the options
"Accept Change" and "Reject Change" if there is actually a change in
the selection. Similarly, in the toolbar, the buttons are only
enabled when there is a change in the selection.

This fixes #10338.
2018-05-10 12:58:44 -04:00
Richard Kimberly Heck
c7a2011adf Remove unused function. 2018-05-05 12:02:10 -04:00
Richard Kimberly Heck
e91245362f Fix indentation. 2018-05-02 19:57:37 -04:00
Richard Kimberly Heck
ba0f28a09b Simplify some code now that we don't need it for indexes.
This has the effect that inserting nomenclature entries does not
cut the selection (implicit or explicit) but rather copies it, which
seems to me to make a lot more sense. If anyone objects, let me know.
2018-04-25 22:22:36 -04:00
Richard Kimberly Heck
aa2f409d87 Restore implicit word selection for inset insertion.
Modifies 83356ab9.
2018-04-25 21:48:25 -04:00
Richard Heck
83356ab9fe Fix #6344.
For some reason, special code was added for LFUN_INDEX_INSERT
when it was not actually needed. So just delete it.
2018-04-20 23:11:04 -04:00
Scott Kostyshak
4e9e9881b2 Greyedouts can be inserted in commands/description
This change also applies to Comment insets. For example, Greyedout
and comment insets can now be inserted in section titles.

The usage of these insets in commands relies on the newly
implemented cprotect feature. The usage of these insets in
description items already worked fine (without cprotect).

This commit also enables modification of these insets (e.g.,
converting a LyX note to a Greyedout note) in commands.

This commit is related to #6969.
2018-04-19 12:35:06 -04:00
Richard Heck
a714f6cb76 Move LFUN_UNICODE_INSERT to BufferView, per JMarc's suggestion. 2018-04-16 22:56:01 -04:00
Richard Heck
f7d502d024 Use FuncRequest::getArg instead of splitting the argument
ourselves.
2018-04-16 22:32:04 -04:00
Richard Kimberly Heck
83b1ac3b55 Fix bug #11084.
Allow unicode-insert to accept a sequence of codepoints.
2018-03-21 23:08:38 -04:00
Richard Heck
92742f63bc Fix bug #10926, and some for loops. 2018-02-24 00:20:03 -05:00
Pavel Sanda
b7caaf6196 Proper naming of LFUN_SET_GRAPHICS_GROUP. 2018-02-08 21:59:41 +01:00
Juergen Spitzmueller
2f854bdf8c remove unnecessary braces 2018-01-20 10:39:18 +01:00
Juergen Spitzmueller
e57b245d0b Work around auto-bibitem insertion when separating bibliography environment
Manually delete bibitem insets in the separator line.

In the long term, such things should not happen at all.

Candidate for 2.3.x.
2018-01-13 15:12:10 +01:00
Juergen Spitzmueller
a09ceda2c4 Once more rework outline wrt environments.
* Fixes UNDO issues
* Takes care of some special cases

Signed-off-by: Juergen Spitzmueller <spitz@lyx.org>
2018-01-13 14:51:01 +01:00
Juergen Spitzmueller
bceaa7f929 Fix loop while separating
getMaxDepthAfter() gives wrong result here.

Fixes: #10979

Signed-off-by: Juergen Spitzmueller <spitz@lyx.org>
2018-01-13 09:59:09 +01:00
Juergen Spitzmueller
2ae51a9bb9 Complement the movement handling of environments
Make sure moved environments (such as frames) are separated from their
new neighbours in all directions.

This completes 07665d1dca
2018-01-12 10:44:01 +01:00
Juergen Spitzmueller
0fc14060b1 Amend 07665d1dca
We need to disable auto-nesting here.
2018-01-11 13:09:04 +01:00
Juergen Spitzmueller
07665d1dca Handle movement of environments better
Make sure moved environments (such as frames) are separated from their
new neighbours.
2018-01-11 10:48:47 +01:00
Jean-Marc Lasgouttes
806f40dbd4 Update buffer when an inset or an INFO inset has bee inserted
This is important for info inset, since if updateBuffer needs to be
run in redoParagraph (for the macro code), crashes can happen.

Fixes bug #10944.
2018-01-05 19:32:17 +01:00
Juergen Spitzmueller
32efb91438 Do note attempt to nest more than possible. 2018-01-04 18:38:08 +01:00
Juergen Spitzmueller
f965d23633 Disable useless environment-split function at the core. 2018-01-03 13:16:07 +01:00
Juergen Spitzmueller
99ae8d58c8 Another case where nesting needs to be preserved. 2017-12-31 14:43:45 +01:00
Juergen Spitzmueller
167c38377c Use real cursor pit, not the modified one. 2017-12-31 09:41:43 +01:00
Juergen Spitzmueller
857e70eb83 Maintain nesting when separating outer environment 2017-12-30 18:54:39 +01:00
Juergen Spitzmueller
5c704b5dd1 Revert "Fix environment-split when at pos 0 of a frame title."
This reverts commit 1ff34a973d.
2017-12-30 16:26:20 +01:00
Juergen Spitzmueller
1ff34a973d Fix environment-split when at pos 0 of a frame title.
This introduces a force argument to argument-insert that inserts
arguments even if they are already there. We need this here in order
to prevent DEPM.
2017-12-30 12:50:48 +01:00
Juergen Spitzmueller
27901b3a06 Fix environment-split previous problem spotted by Joel
Special case: append from the separator paragraph.
2017-12-30 11:54:37 +01:00
Richard Heck
60cb7a1683 Minor code simplification. 2017-12-29 16:00:58 -05:00
Juergen Spitzmueller
f3b89e4c72 Add IsAutoNestedBy
This is complementary to AutoNests: Styles can determine which other
style should auto-nest them. This is particularly useful for modules
that add new styles which should be auto-nested in a given context.
2017-12-29 10:36:03 +01:00
Juergen Spitzmueller
d6fb2abbea Some AutoNest polishment.
* Rename Nests to AutoNests
* Do it when changing from any style
2017-12-29 10:03:00 +01:00
Juergen Spitzmueller
99ecc6e2c9 Implement auto-nesting.
Now layouts can specify other layouts that should be nested in and
after the current one (if the layout is switched from the current one
and if it follows a paragraph in the current one).

This is particularly useful for things such as the beamer frames, where
particular layouts are practically always nested.
2017-12-28 17:44:54 +01:00
Juergen Spitzmueller
87a6c75d9d Introduce environment-split before
This one prepends the new environment rather than appending it.

Easy way to add a new beamer frame before the current one.
2017-12-28 14:17:40 +01:00
Juergen Spitzmueller
2907160fff Introduce environment-split previous
This one checks for an environment in the previous paragraph (outside
the nesting scope).
2017-12-28 12:28:01 +01:00
Jean-Marc Lasgouttes
34285cc683 Handle properly top/bottom of inset with mac-like cursor movement
The correct behavior is to go to position 0 going up from first row,
and to end of row when going down on last row.

The targetx value of the cursor is not updated, which makes cursor
movement more natural.

Fixes bug #10701.
2017-11-23 15:52:08 +01:00