Commit Graph

427 Commits

Author SHA1 Message Date
Stephan Witt
73242e0052 #9477 improved argument handling for LFUN_SPELLING_ADD,LFUN_SPELLING_IGNORE and LFUN_SPELLING_REMOVE 2015-03-27 08:07:05 +01:00
Jean-Marc Lasgouttes
ba0b847040 Toggle properly toolbar icons that set layout of a paragraph.
Fixes bug #9463.
2015-03-17 16:40:55 +01:00
Georg Baum
3e9e6e344a Replace automatic logofication with insets
Previously, LyX did replace some words with typeset logos, and there was no
way to prvent this except putting them, in ERT (bug #4752). Now we have
special insets for these words, and standard text is left alone.
2015-03-01 11:16:57 +01:00
Richard Heck
db954b5dc0 Add comment, so that does not happen again. 2015-02-24 20:07:32 -05:00
Richard Heck
94a5481a17 Partially revert b627b870, which broke cursor movement. 2015-02-24 20:04:59 -05:00
Jean-Marc Lasgouttes
b627b8701b Some performance stuff reported by cppcheck 2015-02-24 18:38:20 +01:00
Uwe Stöhr
4a8881c60a text3.cpp: adapt a possible fix to current code 2015-02-15 01:04:41 +01:00
Juergen Spitzmueller
d48e5330be Add pref option to disable middle-mouse-button paste
Fixes: #9399
2015-02-08 17:41:28 +01:00
Richard Heck
935646bf91 Cleanup of outliner moving code. 2015-01-03 11:33:11 -05:00
Jean-Marc Lasgouttes
38f8858671 Fix warnings reported by clang
All these problems have the same root: the address of a reference can never be 0, and it does not make sense to test it.
2014-11-27 19:10:43 +01:00
Jean-Marc Lasgouttes
e52a385493 Reimplement inset-select-all in a generic way
There are 3 possible actions (in order)
* select current cell
* select all calls of inset
* select the inset from outside (in the containing inset)

This fixes completely #7727.
2014-11-01 16:54:23 +01:00
brokenclock
11e679f73e Add LFUN_SERVER_GET_STATISTICS command
This function can be used with the LyX server to obtain the word, character or character+space count in the current document or selection.
2014-10-23 16:06:42 +02:00
Scott Kostyshak
bcbc162665 Select word on double click even when at boundary
Now when double clicking on a boundary of a word, the
word is selected. This also causes single-letter words
to now be selected (fixes #9159).
2014-06-13 10:48:49 -04:00
Scott Kostyshak
4cfc110d4a Combine OutlineIn and OutlineOut blocks
They differ only by adding/subtracting 1.
2014-06-08 03:33:32 -04:00
Enrico Forestieri
d4c21b42dd Allow inserting a blank line also after a nested environment. 2014-05-26 21:29:33 +02:00
Enrico Forestieri
02e7bc18a7 Simplify the test for inserting a parbreak separator.
Instead of simply taking into account the layout of the previous
paragraph, it is better considering the layout of the environment
in which the previous paragraph may be nested. This makes the test
simpler and, at the same time, more robust.
2014-05-22 21:47:10 +02:00
Enrico Forestieri
52ebcd6280 Correct the check for a command. 2014-05-22 11:51:21 +02:00
Enrico Forestieri
2c613d5686 Fix potential crash.
Use the lfun for breaking the paragraph here, such that the metrics
are updated before the call to the next dispatch.
2014-05-22 11:41:23 +02:00
Enrico Forestieri
10d5897327 Don't allow inserting two consecutive separators. 2014-05-18 18:04:53 +02:00
Enrico Forestieri
0616c8fe32 Disregard font properties changes when inserting a separator.
This allows to output a simple blank line instead of strange constructs.
2014-05-18 17:34:11 +02:00
Enrico Forestieri
a919cd8c68 Take into account that a blank line is always output before a command. 2014-05-18 17:31:58 +02:00
Enrico Forestieri
c668ebf611 Fix bugs #8546 and #9055, and introduce new separator inset.
The algorithm used for breaking a paragraph in LaTeX export is changed
for avoiding spurious blank lines causing too much vertical space.
This change is tied to the introduction of a new inset (with two
different specializations) helping in either outputing LaTeX paragraph
breaks or separating environments in LyX. Both of the above goals were
previously achieved by the ---Separator--- layout and can now be
accomplished by the new inset in a more natural way. As an example,
after leaving an environment by hitting the Return key for two times,
a third return automatically inserts a parbreak inset, which is
equivalent to the old separator layout, i.e., it also introduces a
blank line in the output. If this blank line is not wanted, the
parbreak separator can be changed to a plain separator by a right
click of the mouse. Of course, an environment can still be separated
by the following one by using the Alt+P+Return shortcut (or the
corresponding menu key), but now the plain separator inset is used
instead of the old separator layout, such that no blank line occurs in
the LaTeX output.

Old documents are converted such that the LaTeX output remains unchanged.
As a result of this conversion, the old separator layout is replaced by
the new parbreak inset, which may also appear in places where the old
algorithm was introducing blank lines while the new one is not.
Note that not all blank lines were actually affecting the LaTeX output,
because a blank line is simply ignored by the TeX engine when it occurs
in the so called "vertical mode" (e.g., after an alignment environment).
The old ---Separator--- layout is now gone and old layout files using it
are also automatically converted.

Round trip conversions between old and new format should leave a document
unchanged. This means that the new behavior about paragraph breaking is
not "carried back" to the old format. Indeed, this would need introducing
special LaTeX commands in ERT that would accumulate in roundtrip
conversions, horribly cluttering the document. So, when converting a
modified document to old formats, the LaTeX output may slightly differ in
vertical spacing if the document is processed by an old version of LyX.
In other words, forward compatibility is guaranteed, but not backwards.
2014-05-10 23:25:11 +02:00
Richard Heck
0a6ff99f28 Typos and style. 2014-04-21 11:51:59 -04:00
Jean-Marc Lasgouttes
220fe66a67 Remove duplicate call to Cursor::selHandle 2014-03-17 10:55:49 +01:00
Jean-Marc Lasgouttes
a8c05f20be Whitespace only. 2014-03-14 14:22:26 +01:00
Juergen Spitzmueller
0dc4f4636f Enable environment-split for standard classes (#9023) 2014-03-07 08:58:24 +01:00
Jean-Marc Lasgouttes
ad56bded03 Bug #9005: various things that do not work as intended in passthru paragraphs
* disable branch-add-insert in pass thru paragraphs

* when it is not possible to input a quote inset, insert a single
  ascii quote when argument to quote-insert is "single"

* handle "mathspace" dialog in Text::getStatus

* disable insertion of newline inset in pass thru paragraphs

* handle "mathdelimiter" and "mathmatrix" dialogs in GuiView::getStatus.
2014-03-04 11:56:03 +01:00
Richard Heck
7b46aa8fbb Forgot in previous commit to deal with case. As I'm doing it now,
it's easy to use the existing docstring routine, so I've commented
out the string version of lowercase I had introduced. I've left the
code in case someone else needs it later.
2014-02-23 12:04:56 -05:00
Richard Heck
e5ea535952 If the selection is some sort of URL, then make it the target, not
the name, in the hyperlink. Fixes bug #8792.

This also fixes a bug discovered while working on this code: The
params passed to GuiHyperlink were never used.
2014-02-23 11:36:54 -05:00
Jean-Marc Lasgouttes
e7a1cce551 Rename some LFUN names to match their text name
Also, rename copy-label-as-reference to label-copy-as-reference and update LFUNs.lyx accordingly.
2014-02-13 13:50:33 +01:00
Juergen Spitzmueller
5a3f1a731f Extend environment-split to an 'outer' split function
This fixes a major beamer UI flaw reported by several users.
2014-01-27 08:01:24 +01:00
Georg Baum
c0ea37f337 Fix image pasting regression
I introduced a regression in c14b9e67 for pasting images:
If an image is on the clipboard both as PNG and HTML with just an url,
but no plain text, pasting would fail. The reason for this was that
text contents was detected (the HTML code), nd preferred, but actually
pasting it resulted in an empty string, since the HTML import could not
handle the url This error was not checked.
The solution is first to try text paste if both text and image content
is present, and then  try image paste if the text failed.
2013-07-13 22:44:20 +02:00
Vincent van Ravesteijn
97405fa623 Fix bug 7673 by reverting changes to BufferView::checkDepm
This reverts commit 210a4406 and a part of 5577e877.
2013-05-19 22:17:14 +02:00
Richard Heck
d79225ae98 Remove all messages to user related to assertions. We'll just use
a basic message which is defined in lassert.cpp now.
2013-04-27 17:52:55 -04:00
Richard Heck
1b1f8dd235 Audit all the LASSERT calls, and try to do something sensible at
each failure.

There are several places I was not sure what to do. These are marked
by comments beginning "LASSERT:" so they can be found easily. At the
moment, they are at:

Author.cpp:105: // LASSERT: What should we do here?
Author.cpp:121: // LASSERT: What should we do here?
Buffer.cpp:4525:        // LASSERT: Is it safe to continue here, or should we just return?
Cursor.cpp:345:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:403:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:1143:                // LASSERT: There have been several bugs around this code, that seem
CursorSlice.cpp:83:     // LASSERT: This should only ever be called from an InsetMath.
CursorSlice.cpp:92:     // LASSERT: This should only ever be called from an InsetMath.
LayoutFile.cpp:303:                     // LASSERT: Why would this fail?
Text.cpp:995:           // LASSERT: Is it safe to continue here?
2013-04-25 17:27:10 -04:00
Georg Baum
c14b9e67bc Implement paste from LaTeX and HTML (bug #3096)
As discussed on the list. No automatic contents detection is done, the user
needs to use the special paste menu instead. I used the new TempFile class
for safe temporary file handling.
The documentation would go into section 2.2 of UserGuide.lyx, but I am not
allowed to edit that document.
2013-04-14 19:45:36 +02:00
Georg Baum
c61ef8b205 Support \caption* (bug #3209)
This was a low hanging fruit which would have to wait for a long time because
of a file format change if it was not implemented before 2.1.
2013-03-22 22:23:38 +01:00
Richard Heck
57d8b059e0 Remove references to Counter LabelType from source code. The
intention is to use Static in its place, and we now expand the
label for these, as well.
2013-02-09 13:44:05 -05:00
Jean-Marc Lasgouttes
db025be5ae Consider deleted text when inserting quote inset.
This bug was reported against the ubuntu build:
  https://bugs.launchpad.net/bugs/1100046

Additionally, some extra code for avoiding double undo entries has
been removed, since this is handled by grouped undo now.
2013-01-21 14:49:45 +01:00
Juergen Spitzmueller
c246076ed5 Fix the 'caption inset mess' (bug #4647) 2012-12-30 18:29:02 +01:00
Juergen Spitzmueller
7c9254b723 LFUN_ENVIRONMENT_SPLIT: simplification 2012-12-24 11:22:23 +01:00
Juergen Spitzmueller
3e8bfd8bd6 Convenience LFUN to split an environment 2012-12-23 18:57:32 +01:00
Vincent van Ravesteijn
bec9c1325e Introduce Layout::args() and simplify code 2012-12-17 22:26:11 +01:00
Juergen Spitzmueller
e5ebe17b92 AutoInsert option also for flex insets 2012-12-17 13:32:40 +01:00
Juergen Spitzmueller
dd21e57bd3 Option to auto-insert a paragraph style option, particularly useful for specific mandatory arguments (such as beamer block or frame titles) 2012-12-16 13:37:14 +01:00
Juergen Spitzmueller
dcaab11b09 Correctly handle environment sequences in TOC
Only the first paragraph in those sequences goes into the TOC, since the environment is merged.

This is needed to handle the forthcoming beamer environments properly in the outliner.
2012-12-15 16:50:08 +01:00
Juergen Spitzmueller
99ee47f0cd Disallow the insertion of multiplenon-item arguments of the same type in a sequence of merged environment pars 2012-12-10 09:19:56 +01:00
Juergen Spitzmueller
1500e44cba Support for \item arguments 2012-11-29 15:34:20 +01:00
Richard Heck
1252c22fd3 Some minor cleanup of new InsetArguments stuff that I did while
reading the patch....
2012-11-23 20:40:38 -05:00
Juergen Spitzmueller
99e611b2d8 Allow arguments in PassThru environments (bug #7646) 2012-11-20 16:58:51 +01:00