Commit Graph

25468 Commits

Author SHA1 Message Date
Kornel Benko
358626b735 FindAdv: Add handling spaces, dots, quotes ...
Treate spaces, dots and quotes as ordinary characters
Also discard length values for hspace,vspace and mspace
2018-12-13 17:12:57 +01:00
Jean-Marc Lasgouttes
2ec25c8eef Set buffer correctly when changing math space type.
Fixes bug #7747.
2018-12-13 10:27:20 +01:00
Kornel Benko
8a29bdb3d1 FindAdv: Added code, href, url and footnote to handled search formats
Remark: Inside code{} and footnote{} are the language settings ignored.
2018-12-11 17:27:50 +01:00
Pavel Sanda
9547e0b765 typo 2018-12-08 00:04:04 +01:00
Pavel Sanda
04fe818b22 Keep permissions of the saved files intact.
Previously the permission were destroyed by the newly created
temporary file -- which is later used as new saved file.
Tested on symlinks as well but only on Linux.
2018-12-07 23:10:46 +01:00
Kornel Benko
32c6724fd6 FindAdv: Amend cd941804
Revert changes in Paragraph.cpp
2018-12-06 14:20:43 +01:00
Enrico Forestieri
976e0b7993 Amend bd21aa9
Check whether a line is actually blank rather than whether
we are at the beginning of a line.
2018-12-06 10:30:58 +01:00
Kornel Benko
cd94180492 FindAdv: Simplify search for chars '&', '%', '#' and '_'
This is not possible for '$', because of the latex-meaning to
start/end math inset.
Therefore, if not ignoring format, we still have to use
[\\][\$] in regex in order to find '$' in text.
2018-12-05 13:36:43 +01:00
Guillaume MM
131f4b92ba Fix segfault after deleting monitor
The boost signal was sent synchronously, and so made the Qt signal to be posted
in FileMonitor::changed after the boost signal returned, so after the sender was
possibly destroyed.

The solution is to make the boost signal asynchronous using the Qt event loop.

Thanks to Scott Kostyshak for the report and MWE.
2018-12-04 00:05:01 -05:00
Enrico Forestieri
bd21aa99d2 Fix bug #11398
When deciding how to strike out deleted math in change-tracking
mode, differentiate only on begin-of-line or not, and not on
after-paragraph-break or not.

The assumption that a new paragraph is always started after a
float seems to be not true and was causing this bug.
2018-12-02 18:27:38 +01:00
Pavel Sanda
1047754228 Update after buffer-anonymize in branch.
This is not strictly necessary in master (compared to 2.3.x),
but JMarc wanted it anyway.
2018-12-02 02:24:04 +01:00
Kornel Benko
de4ca7b742 FindAdv: Use plain text as value for \index{}
If we are in search mode, there is no need for
any special handling.
2018-11-29 11:57:11 +01:00
Kornel Benko
1cd80ff6c8 FindAdv: Eliminate a corner case in the binary search
Given the regex 'r.*r\b' and a string
"abc regular something cursor currently"
we expect to find "regular something cursor".
But while searching we may be confronted with input
"regular something cursor curr"
and so the searched string would be seen longer.
2018-11-27 19:10:27 +01:00
Kornel Benko
8549fbb326 FindAdv: Avoid crash finding char at end of inset
Testcase without this patch:
1.) open de/Additional.lyx
2.) goto 6.1 Astronomy & Astrophysics
3.) open the index
4.) find advaced
	a.) not ignoring format
	b.) regex = .+
	c.) language of regex: English
	4.) search next
The seach finds the next break (which is outside of the index)
The following try to display the selection leads to crash
2018-11-26 12:37:18 +01:00
Kornel Benko
578a4b6fb0 find: This change was not intended, amend e96a9d6329 2018-11-25 18:25:14 +01:00
Kornel Benko
e96a9d6329 Find: Use greedy behaviour
This change is valid for findadv too.
Patterns like '.*' now are greedy, like it is normal in regex
Searching for whole words is corrected, but can be slow.
One can speed up the search with adapted pattern.
So for instance searching for words starting and ending with 'r'
the normal pattern is 'r.*r'. The speed-up pattern could be
'\br[^\s]*r\b'. This halves the search time.

Search results are now different to that of lyx2.3, because the greedy
'.*' is now really greedy.
To achive the same results, we have to use '.*?' instead.
2018-11-25 17:51:20 +01:00
Jean-Marc Lasgouttes
e2a3dd1167 Fix compilation with msvc 2015
Without this, the compiler does not know whether 0 is a size_t or char
const *.
2018-11-24 19:17:31 +01:00
Jean-Marc Lasgouttes
57feb0fed0 Fix undo after breaking a nested paragraph
We have to take into account that Buffer::updateBuffer can modify the document.

Fix bug #11292.
2018-11-23 16:53:53 +01:00
Jean-Marc Lasgouttes
2dc84b69d5 Show cursor correctly whn loading file
This is a fixup to 8d8988de4. When a file is loaded and the cursor is
set, it is required to first compute metrics to be able to scroll the
screen correctly.

Fixes bug #11377.
2018-11-22 11:21:07 +01:00
Kornel Benko
e9e3c50c65 FindAdv: Optimization
A try to decrement the number of tests for a match.

Also a try to handle Hebrew documents. Unfortunatelly
the latex output is missing the language specification
(only the change of encoding is available there).
I failed to find a proper place to add the lang.
That means, searching for e.g. English text in Hebrew documents
is not satisfying.
2018-11-20 14:36:11 +01:00
Kornel Benko
17ee4cafb1 FindAdv: Enable search for different languages in Korean documents too
The problem here was that for european languages only the encoding
was visible in latex output. Now also the language is provided.
2018-11-18 10:40:42 +01:00
Enrico Forestieri
7822d11361 Fix reloading of local layout file (bug #11120) 2018-11-16 21:47:24 +01:00
Kornel Benko
0964ffb266 FindAdv: Remove left over comment character
Sometimes language spec starts with "% ". This happens in Japaneese documents
containig English text at start of paragraph.
2018-11-16 12:12:06 +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
Kornel Benko
702c495e98 FindAdv: Significantly increase the search speed
The needed time to find a simple string dependes on the
paragraph length was O(n^2)
Now it is down to O(n).
Before:
	To determine if the pattern matches we compared the
	paragraph from current position to the its end.
	Increment current position if no match
Now:
	Check if the character at current position has at least
	the needed features (text, color, language etc)
	If not, Increment current position
	else proceed as before
2018-11-13 12:11:33 +01:00
Enrico Forestieri
1bdba953a5 Fix cursor left/right navigation in overset, underset, and stackrel
Before this commit, navigating with the cursor was visiting either
the nucleus or the script depending on the direction (left or right)
of the cursor movement. Now the 2.3.x behavior of always going through
the nucleus is restored (at least for overset and underset, as stackrel
seems to behave oddly also in 2.3.x).
2018-11-12 19:05:09 +01:00
Kornel Benko
636bb6c2d9 FindAdv: Polishing search with regex containing '.'
Also added missing math env alignat
Modified handling of longtable/tabular
Added a routine to count for valid chars. This is needed
for detection of word boundaries.

Due to detection conflicts
	regex '.*' vs match of word-boundaries in MatchStringAdv::operator()
we need to use '\b' in regex explicitly. E.g. '\b.*\b'

The backward search works, but
1.) only in current paragraph (this is the same as before)
2.) only in the same language environment.
2018-11-12 12:28:31 +01:00
Jean-Marc Lasgouttes
1ff0816a02 Typo 2018-11-12 11:41:54 +01:00
Enrico Forestieri
9c3bbeefab Fix bug #11367
The overset, underset, and stackrel insets behave like the script
rather than the fraction inset.
2018-11-10 15:50:51 +01:00
Enrico Forestieri
77234fecd8 Restore correct left/right navigation in root inset
Now all cells are correctly visited in sequence when moving with
cursor left/right.
2018-11-10 14:55:00 +01:00
Jean-Marc Lasgouttes
93db2bd08e Make cell-forward/backward cycle in math
Make cell-backward put the cursor at the end of cell when using
mac-like cursor movement.
2018-11-09 16:05:09 +00:00
Jean-Marc Lasgouttes
ee9451aaf5 improve left/right navigation in root inset
Now the cursor is correctly set when changing cell with xursor left/right.
2018-11-09 16:05:09 +00:00
Jean-Marc Lasgouttes
7055bb0098 Change IgnoreFormats to a proper class
Instantiate a global variabble holding the formats and allow to modify
it using the helper function setIgnoreFormat.
2018-11-09 16:05:09 +00:00
Kornel Benko
f5d5777a86 FindAdv: Polishing
1.) Added \textmd to be ignored (sometimes it is used and sometimes not)
2.) Typo: multiline --> multline. Searching in 'multline' caused a crash
	because processing all of the '{' and '}' in the content of this math
	exceeded the size of the interval field.
2018-11-09 13:49:05 +01:00
Juergen Spitzmueller
523d284729 missed this. 2018-11-09 11:47:51 +01:00
Juergen Spitzmueller
a5004a394a Fix thinko
Actually use the replaced path string :-/
2018-11-09 11:28:38 +01:00
Kornel Benko
0c05432284 FindAdv: Polishing
1.) Handle some unclosed parentheses
	Sometimes \shortcut is not correctly closed
2.) Added \ldots as known char
3.) Discard some shapes (circlepar, droppar, ...)
4.) Omit resulting empty string and use some value
	which cannot be matched instead
2018-11-08 09:59:51 +01:00
Jean-Marc Lasgouttes
2daf493cbc Fixup 097da3a9: fix horizontal navigatiion in InsetMathRoot
Exchanging cells 0 and 1 requires to implement idxBackWard/Forward.
2018-11-07 11:53:00 -10:00
Jean-Marc Lasgouttes
974766cd1c Fixup 097da3a9: update the math parser
One has to account for the change in cell numbering.
2018-11-07 08:29:46 -10:00
Kornel Benko
88428123ea FindAdv: Optimize for long matches
Still, if the matched string is at a rear part of a very long
paragraph, the search is way too slow.
2018-11-07 13:14:50 +01:00
Jean-Marc Lasgouttes
b0937fb93e When inserting math inset over selection, place cursor better
This is a follow up to 503c7c16.

The new argument for placing cursor after insertion of inset is:
* if inset has no cell, do nothing
* otherwise, place inset in entry cell.
  + if entry cell is not empty (we pasted a selection), go to next cell
  + if this next cell does not exit, stay after the inset.
2018-11-06 22:48:53 -10:00
Jean-Marc Lasgouttes
097da3a943 Change cell numbers so that 0 is the main cell
This leads to code simplification in overset, root and underset.
Further simplification is possible.
2018-11-06 22:48:53 -10:00
Kornel Benko
9d304c0a1d FindAdv: Discard table decorations
That way we do not match the whole table but only the cell contents.
The problem I had was
1.) Document language Spanish
2.) Table (copied from English doc) => language English
3.) All cell contents Spanish

Now search for English text led to a selection of the whole
table, although there was no English content in any cell.
2018-11-07 09:35:16 +01:00
Kornel Benko
4f1cd00b02 Findadv: Initialize the position of first unprocessed open parentheses
Not initializing caused some wrong matches.
2018-11-06 15:28:43 +01:00
Kornel Benko
e487274ff4 Findadv: Polishing
1.) Do not remove '{}' unconditionally from \item parameter
2.) Do not output last empty entry
2018-11-05 12:58:45 +01:00
Jean-Marc Lasgouttes
7db99672e6 Avoid extra space in tooltips
When using QTextDocument to check the natutal size of a text, one has
to remove the text margin, which is not useful here.

Fixes bug #11353.
2018-11-04 14:02:42 -10:00
Kornel Benko
70e2f09c4f Findadv: Some glitches found while searching for English text in fr/UserGuide.lyx
Ignore \index
Handle \og and \bg as characters
Remove space in empty list-item (description or labeling)
2018-11-04 21:41:04 +01:00
Kornel Benko
aa68dcefa0 Findadv: 'Optimized' detection of matched string
This is clearly a hack, because I don't understand why the
previous code did not work.
2018-11-04 14:57:40 +01:00
Jean-Marc Lasgouttes
1bed76e2a1 Fix selection of unmarked RtL text
With Qt 5.11 at least, RtL text will be drawn RtL even when the
(undocumented) flag Qt::TextForceLeftToRight is applied to the
QTextLayout object. This creates selection issues for Hebrew text
marked as English.

The solution is to do the same as in breakAt_helper, that is prepend
the string with a direction override unicode character.

Doing this requires to introduce a TEXTLAYOUT_OFFSET constant that has
to be used wisely to account for this extra character.

Fixes bug #11284.
2018-11-04 08:23:49 +00:00
Jean-Marc Lasgouttes
76e99e9a20 Remove old workaround that is not needed anymore
This causes a compilation error with boost 1.69.

Fixes bug #11349.
2018-11-04 08:23:49 +00:00
Kornel Benko
5c2f29d024 findadv: Output language chage in ANY case, if outputting for search
Without this, the first \item entry in a list does not specify the language
in latex output. But we need it if we do not ignore language in search.
2018-11-03 15:05:38 +01:00
Kornel Benko
e6418431dd Findadv: Handle the problem with list environments
The problem was, that the different list ennvironments
did not look different in tha latex output used for
search.
So the input of "\item ..." did not give information
if it is description, lyxlist, enumeration or labeling.

In search modus we use now "\item{enumeration}" etc.
2018-11-03 11:15:12 +01:00
Kornel Benko
5c83ad37d0 Findadv: Use '\n' as delimiter for end of data with same features
This allows to use '.' in regex without matching also wrong data.

Also added modified patch from ajd (see #11241).
2018-11-02 10:32:28 +01:00
Kornel Benko
5af8ec3240 Findadv: Allow multiple math statements in a line 2018-10-30 20:54:32 +01:00
Juergen Spitzmueller
b8932afed5 Dispay pre- and posttext widgets if non-empty also if unapplied
Fixes: #11352
2018-10-30 17:23:08 +01:00
Juergen Spitzmueller
0ec295d63e Fix parentheses with Hebrew
Patch by Guy Rutenberg, with some changes of mine.

Fixes: #11191
2018-10-30 12:33:35 +01:00
Kornel Benko
f0d7432608 Findadv: Remaining findadv tests pass now
Exception: findadv-21, but it is not a regression,
because this one never passed.
The problem here is, that we cannot differentiate
between enumeration, itemize, description and labeling
environment here.
2018-10-29 13:17:54 +01:00
Kornel Benko
aecd98dc46 Findadv: Adapt search for special chars '[', ']', '%' and '#' 2018-10-29 07:37:32 +01:00
Kornel Benko
2d477c5e0a Changes to match math equations
Now tests findadv-01 ... findadv-20 pass too.

keytest.py: Expanded time for controll keys (like \[Return])
findadv*: expanded time for normal keys
lyxfind.cpp: Handle math equations
2018-10-28 19:40:14 +01:00
Scott Kostyshak
645d42f451 Revert "Comment out unused functions to restore -Werror"
This reverts commit bceb2390b4.

For details, see:

https://www.mail-archive.com/search?l=mid&q=4724814.5HqUF52VLN%40amd64
2018-10-28 11:43:47 -04:00
Scott Kostyshak
bceb2390b4 Comment out unused functions to restore -Werror
This commit restores compilation with -Werror and g++ version 7.3.0.

Consistent with 6dc450bc.
2018-10-27 20:59:26 -04:00
Kornel Benko
0f72179a07 Amend(4) 74c849d Advanced search with format
Prepare for use with func request. For instance to
ignore language while searching:
	setIgnoreFormat("language", true);
2018-10-27 16:57:42 +02:00
Stephan Witt
d470477ab0 Add dummy implementation for Messages::getIfFound (used when ENABLE_NLS is false) 2018-10-27 16:12:02 +02:00
Kornel Benko
0b3f644469 Amend(3) 74c849d Advanced search with format
* Discard now unneeded code
* Remove macro '\uldepth=...'
2018-10-24 11:07:11 +02:00
Kornel Benko
2dd522472a Amend(2) 74c849d Advanced search with format
Added missing handling for chapter/chapter*
Also added frontmatter (title, author etc), but disabled ATM
2018-10-23 21:12:22 +02:00
Kornel Benko
ff9c32b382 Amend 74c849d, Advanced search with format
Remove macros like '\tiny ' or '\tiny{}' or '\tiny' followed by
any other non-alpha char correctly
2018-10-23 20:03:50 +02:00
Scott Kostyshak
73b1c658a2 Use underline in (+ bold) for char match in layout
When showing the match characters in, e.g., the layout box, we now
underline (in addition to bold) the matched characters. This makes
the matched characters stand out even more.

See 4b716dd6 and the following ML thread:

  https://www.mail-archive.com/search?l=mid&q=20181019155649.dqqk6u25wdcdimrj%40barna
2018-10-22 21:16:56 -04:00
Kornel Benko
74c849d651 Advanced search with format, preparing for selective searching
As it is now, searching with format needs ALL the features set
in order to match the pattern.
What needs to be done is a GUI specifying which of the features are
important.
1.) language
2.) font (series, shape)
3.) markup, underline, strikeout
4.) color
Having this info, the implementation is easy. Set
some variables and be done
2018-10-22 20:19:36 +02:00
Jean-Marc Lasgouttes
9e7832915f Amend 8d8988de: it is too early for skipping the updateMacros call 2018-10-22 15:29:56 +02:00
Kornel Benko
140f843690 Advanced search with format, consider also sectioning macros 2018-10-20 12:47:37 +02:00
Kornel Benko
0be01de61f Advanced search with format, refactoring 2018-10-19 19:11:20 +02:00
Kornel Benko
6dc450bc46 Commented out an unused function to please a picky compiler 2018-10-19 11:10:54 +02:00
Jean-Marc Lasgouttes
557c2f2bf0 Compilation fix (with qt4 at least). 2018-10-19 10:02:02 +02:00
Richard Kimberly Heck
4b716dd63d Use bold instead of underlining to mark the characters we're matching. 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
1410eeb10e Simplify the code that adds underlining to the layout combo. 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
1cc859d713 Refactor 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
35fac4ab51 Re-organize and simplify now. 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
ae65fb2c98 Whitespace. 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
d7f4346a19 Fix bug #6096.
We used to need a hack to set the size of the layout combo, but
the code was changed in Qt 4.5 or so. Hence the appearance of this
bug in 2009. We can now just remove this hack, and all seems to
work correctly.
2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
938ef60258 Filter on consecutive sequences of characters.
The filters for the layout combo and document class combo share a
problem: If you type "beam", e.g, in the latter case, then we will
show any document class that contains those letters, in that order,
but not necessarily consecutively. This is extremely confusing and,
as José put it, just weird. So let's fix it.

I'd call this a bug so would be happy to see this in stable, too.
2018-10-18 21:49:31 -04:00
Kornel Benko
d6cc58f4a3 Amend(4) 7a03fa6: Advanced search with format:
Further normalize the latex input in case of enabled format search.

It was not enough to split the latex input on \foreignlanguage and \textcolor
macros only.
Instead also macros like \textt, or \noun etc had to be accounted for.

This patch uses therefore a different algorithm.
2018-10-18 17:37:15 +02:00
Kornel Benko
162c1f316b Amend(3) 7a03fa6: Advanced search with format:
Grrr... enable the search without format again
2018-10-15 08:09:19 +02:00
Kornel Benko
8b21b2f8fb Amend(2) 7a03fa6: Advanced search with format:
Further tweeking.
2018-10-14 20:39:13 +02:00
Kornel Benko
1967d5411c Amend edca2e0: copy && paste error 2018-10-13 22:22:48 +02:00
Kornel Benko
edca2e0c4a Amend 7a03fa6: Advanced search with format:
In the latexified text:
* Check and handle contained regex properly
* Discard superfluos '{' preventing our search engine
  to match with the search pattern
2018-10-13 21:08:26 +02:00
Juergen Spitzmueller
3a91fed269 Amend a754912 once more
Do not use LTR environment (bidi) at all, since it adds unwanted
paragraph breaks.

Fixes: #11338
2018-10-13 13:51:00 +02:00
Juergen Spitzmueller
4115d2487f Clear bibfile cache when set of bibliography files change
Part of #9158
2018-10-13 11:06:24 +02:00
Kornel Benko
7a03fa6f1d Advanced search with format: Prepare latex for find
Our findadv expects something like
	prefix + 'search'
so that the regex (which is latexified too)
can work on 'search'
(In the source, the prefix is denoted by lead_as_string)

The latex output contains structs like
	\foreignlaguage(abc}{xx\textbf{boldxx\textcolor{blue}{blue 1 blue 2} XX}}
which would never match the simple prefix.

Now the above is converted to
	\foreignlaguage(abc}{xx}\\
	\foreignlaguage(abc}{\textbf{boldxx}}
	\foreignlaguage(abc}{\textbf{\textcolor{blue}{blue 1 blue 2}}}\\
	\foreignlaguage(abc}{\textbf{ XX}}
Of course, more than one language or color in an inset can be searched for now.
2018-10-12 16:47:07 +02:00
Juergen Spitzmueller
9d8fbc7fd1 Amend a754912
Switch logic, since isStyle() does not cover inline math

Fixes: #11338
2018-10-09 18:04:51 +02:00
Juergen Spitzmueller
00ee54e694 Load covington later
This solves a loading order conflict with beamer-article.
2018-10-09 10:42:38 +02:00
Jean-Marc Lasgouttes
17e2ad927e Followup to 9fe101e8: remove unused method. 2018-10-08 16:04:32 +02:00
Jean-Marc Lasgouttes
9fe101e890 Remove support for pixmap cache
This code has issues and there is no evidence that it improves performance.

Remove LyXRC variable \use_pixmap_cache and update rc format to 29.

Now the global pixmap cache is only used by GuiCompleter. Therefore
there is no need to reset it when fonts change.
2018-10-07 14:56:55 +02:00
Kornel Benko
ff933b52f5 Amend(2) b78bdf8
Modified language handling

Still, there are problems, because sometimes the search pattern
does not contain the the requested info. So the 'find' often fails
for strings inside a list environment.
2018-10-06 23:50:50 +02:00
Kornel Benko
f2d82f879e Amend(1) b78bdf8
In advanced search:
* Ignore font sizes
* ignore \\[a-z]+par{} macros
* ignore \\inputencoding{...} macros
2018-10-06 09:58:29 +02:00
Kornel Benko
b78bdf80a8 Added better handling for languages and colors for advanced F&R
The change is significant if the search format is not disabled.
We try to analyze the pattern string first to get needed features
for the search.
We try to analyse the searched string and if it does not
contain all expected featers (color, language, char style, char decoration)

Still some problems though
2018-10-05 20:26:44 +02:00
Richard Kimberly Heck
b1f1b2321b Fix part of bug #8521. 2018-10-04 21:02:51 -04:00
Richard Kimberly Heck
4f0ccae399 Fix bug #9004.
I'm not entirely happy with this way of doing it. It seems messy.
But there is not another clear option right now.
2018-10-04 20:37:03 -04:00
Richard Kimberly Heck
944b0ae55d Update the Advanced F&R document class when switching buffers. 2018-10-04 20:30:01 -04:00
Richard Kimberly Heck
5064c09e9f Copy modules into the Advanced F&R pane as well. 2018-10-04 20:30:01 -04:00
Guillaume Munch
1979496399 Make tab movement visible (#10733)
The nice hand-made solution for moving tabs has made its time. Use Qt's feature
instead from now on.
2018-10-04 19:52:21 -04:00
Richard Kimberly Heck
17b7eab0cc Fix up e5fc7327. 2018-10-04 17:56:14 -04:00
Richard Heck
5f6332bf46 Fix bug 9798.
Nameref support for math references.
2018-10-04 14:04:48 -04:00
Richard Kimberly Heck
2553b0073f Fix bug #11275.
Show module name with description.
2018-10-04 14:02:01 -04:00
Richard Kimberly Heck
e5fc7327e3 Extend fix for #7404 to allow any inset collapsible to be edited
externally.
2018-10-04 13:41:41 -04:00
Jean-Marc Lasgouttes
7cb0284a3f Fix display of gather in lefteqn mode
The column is flushed when the display of equations is flushed.

Not sure what to do with RtL languages.

Fixes bug 11324.
2018-10-04 16:09:54 +02:00
Jean-Marc Lasgouttes
2617a4dd50 Fixup 38f09c177b: limit to paint rectangle 2018-10-04 14:27:43 +02:00
Jean-Marc Lasgouttes
38f09c177b When ignoring an update, request one for later
If we were not ready to paint the screen, this does not mean that we
should give up on repainting, just potpone it.

I thought that it was bad to call update() in the paint event, but I
cannot find reference to this anymore and everything seems to work as
intended.
2018-10-03 15:57:11 +02:00
Jean-Marc Lasgouttes
837bcbb043 Make sure inset buffer is correctly set in math grid
Make MathData::setBuffer set the buffer of insets that it contains.
Remove corresponding code from InsetMathNest.

update the buffer() property in the following tabular-feature
actions : copy-row, add-row, copy-col, add-col.
2018-10-03 10:43:20 +02:00
Kornel Benko
99174acff8 Increment version to 565 due to add of adobe source pro fonts 2018-10-02 17:24:47 +02:00
Kornel Benko
2348e0b615 Advaced search: Added handling to search for colored text
if used with format enabled
2018-10-02 11:53:01 +02:00
Kornel Benko
4eb5ac9a2c Amend(4) 73188e3
* Added textsl, texttt, uline, uuline, sout, xout to the list of possible
  leading strings.
* Account for correct number of open braces in regex.
  Now the search works for enbled format too.

This is hopefully the last amend
2018-10-01 12:06:42 +02:00
Kornel Benko
cc0c58839f Amend(3) 73188e3
Adapt the positional references in regex supplied by user
so that for instance '([a-z]+)\s\1' to find identical words in sequence
is changed to '([a-z]+)\s\2'.
2018-09-30 18:37:55 +02:00
Kornel Benko
2fdc52df19 Amend(2) 73188e3.
Added noun, textsf and texit to the list of possible
leading strings if searche with format enabled.
Searching seems to work as intended now.
2018-09-30 16:15:45 +02:00
Kornel Benko
0e61e6f014 Amend(1) 73188e3.
This is slightly better, but still not satisfying.

Enable format search
Given the latexified string
	\emph{Fox jUMps}
and using emphasized regex '\w*', we find 'Fox'. That is OK.
But the next find finds ' ', which is not OK.
In contrast, searching with '\w+', we find the correct string 'jUMps'.
2018-09-29 18:46:21 +02:00
Juergen Spitzmueller
f973855bde Amend cab46ff9d1 2018-09-29 10:29:02 +02:00
Kornel Benko
ded0dc4c1c Try to make findadv more robust if not ignoring format
If searching for instance '.+' , the found string expanded
to the end of search buffer. So we have to replace
'.' with '[^\}]'.
Also all constructs like '[^abc]' had to be changed to '[^abc\}]'
to not go behind the actual format.
There is still problem using '*', but constructs usin '+' seem to work now.
('.*' finds everything from first char in correct format
 to (including) end of next format change
 while '.+' find _only_ characters in correct format)
2018-09-29 09:38:45 +02:00
Juergen Spitzmueller
cab46ff9d1 GuiCitation: Add some tooltips for the sake of keyboard users
Addresses #11317
2018-09-29 09:18:26 +02:00
Juergen Spitzmueller
10c06f67c9 Use LTR environment for forceLTR content with polyglossia
Fixes: #10548
2018-09-28 08:36:44 +02:00
Richard Kimberly Heck
92ccf0a1a2 Allow 'module in child not used in master' warning to be disabled. 2018-09-27 21:58:37 -04:00
Enrico Forestieri
83fc0f924c Fix bug #11210
On Windows, start viewers in detached processes in order to avoid
a crash of the QProcess destructor when their thread terminates.
The opening of a console window is avoided by redirecting to the
null device all standard I/O channels.
2018-09-27 21:21:49 +02:00
Juergen Spitzmueller
a89e3c344b Add bibtex inset to outliner if "add to toc" is checked.
Fixes #11309
2018-09-25 15:24:46 +02:00
Juergen Spitzmueller
90b1345203 Do not store empty posttext for qualified citations
Fixes: #11308
2018-09-25 13:13:56 +02:00
Juergen Spitzmueller
9c33bbed10 Rework chessboard support
* Use a module rather than a layout, since this package can be used with
  any class
* Do not hardcode options and settings. The package is very flexible,
  there is no need to limit this in LyX
2018-09-23 12:26:43 +02:00
Juergen Spitzmueller
33d6499bbc GuiCitation: don't reset filter on show
Addresses #11291
2018-09-22 10:37:22 +02:00
Stephan Witt
d9c0807227 Add -headerpad_max_install_names option to linker calls and make run path configuration consistent.
This avoids failures when running install_name_tool on Mac when creating relocatable binaries using the bundled private frameworks.
2018-09-21 21:46:47 +02:00
Jean-Marc Lasgouttes
1b5ccecd65 Avoid space before completion in mathed
This can happen if the current element has space after it (e.g. before
a relation).

Fixes bug #11283.
2018-09-20 23:51:21 +02:00
Jean-Marc Lasgouttes
2cfbc5ecf6 Ignore horizontal wheel scrolling in workarea
We do not know what to do with horizontal scrolling events, so we ignore them.

Note that the code has to be different between Qt4 and Qt5.

Fixes bug #11257.
2018-09-20 23:25:42 +02:00
Jean-Marc Lasgouttes
17576fb83b Avoid crash with cursor down in math
This can happen when the inset that contains the cursor is outside of
the screen.

THis is only a workaround. The real solution would be a
processUpdateFlags(FitCursor) call, but the code is not ready for that
yet.

Fixes bug #11296.
2018-09-20 22:18:36 +02:00
Jean-Marc Lasgouttes
328ff9df3a Paint underline for insets too.
Fixes bug 11297.
2018-09-20 11:58:08 +02:00
Juergen Spitzmueller
5e26a3a633 Implement layout format in insetinfo
The docs refer to the outdated layout formats. The inset prevents this.
2018-09-20 11:33:03 +02: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
Jean-Marc Lasgouttes
82516e356b Use std::move in InsetText::updateBuffer for notes and friends
Avoid as much as possible to do full copies of all counters, since
that can be expensive. Unfortunately, it is only posible when we want
to restore the saved counters.

An earlier version (05d3a649) defined swap() for Counter, but caused
problems on windows.

Part of bug #5973.
2018-09-18 23:18:17 +02:00
Jean-Marc Lasgouttes
f5f2f5b7ea Revert "Use swap in InsetText::updateBuffer for notes ad friends"
This reverts commit 05d3a64952.
2018-09-18 23:07:48 +02:00
Jean-Marc Lasgouttes
0920872ebd Revert "Try to please windows compiler"
This reverts commit a8b0e64094.
2018-09-18 23:06:36 +02:00
Jean-Marc Lasgouttes
ad29b0067f Revert "Use new display() values to remove some inset hardcoding."
This is a work in progress that committed by mistake.

This reverts commit b28ec44476.
2018-09-12 15:26:15 +02:00
Jean-Marc Lasgouttes
b28ec44476 Use new display() values to remove some inset hardcoding.
The enum is now made of flags that can be combined.

This introduces several new values for Inset::DisplayType:
BreakBefore, BreakAfter and Display=BreakBefore|BreakAfter. This
last value replaces AlignCenter.

Additionally the flags NoBoundary and CanBreakAfter are introduced for
future use.

Now a left aligned displayed inset will be defined as Display|LeftAlign.

A newline inset is characterized as BreakAfter.

This structure is used in breakRow to avoid explicit calls to
isNewline() or isEnvSeparator(). More improvements will be built on
top of this.

Additionally several redundant display() methods (which returned
Inline) have been removed.
2018-09-12 11:38:01 +02:00
Jean-Marc Lasgouttes
7485225cc6 Place the depth bar correctly in screen mode
In full screen mode, it is possible to restrict the text width. In
this case, the paint bar should not be painted outside of this
restricted area.

Fixes bug #11286.
2018-09-11 16:45:48 +02:00
Juergen Spitzmueller
e158d661b9 Amend 2d4ac90fd2 once more
Only use local switch in RTL environment.
2018-09-10 12:29:22 +02:00
Jean-Marc Lasgouttes
819cf53c22 Handle branches with space in their name
1/ Handle space in color name in set-color (with quoting)

2/ read properly branch inset when name has a space

Fixes bug #11108.
2018-09-08 13:07:07 +02:00
Juergen Spitzmueller
1116335977 Amend 2d4ac90fd2
Properly close local language switch.
2018-09-08 12:50:42 +02:00
Jean-Marc Lasgouttes
6cfd733dea Fixup 7b7ed64a: allow toggling limits of (over|under)brace 2018-09-05 17:31:05 +02:00
Jean-Marc Lasgouttes
7b7ed64a0e Allow toggling (no)limits only after mathop symbol
In particular, introduce the new InsetMathScript::allowLimits method
that checks for that and honor it in getStatus/ddoDispatch.
2018-09-03 17:55:27 +02:00
Richard Kimberly Heck
6014492699 Try yet again try to fix bug #9158.
The problem with the previous attempt was that, every time through
updateBuffer, we looked up the file location using kpsewhich, which
took too long on Windows. The new solution is to cache that info, and
to look it up only when we need it.

Previously, this info would have been re-read whenever we parsed the
bibfiles. So we re-read it now whenever the bibinfo cache is invalid,
which is less often, but should be good enough. We can add more such
re-reads if need be.
2018-09-02 11:50:03 -04:00
Juergen Spitzmueller
5f7b553a1c use masterBuffer() rather than parent()
This also catches grandparents.

Thanks, Riki.
2018-09-02 10:17:23 +02:00
Richard Kimberly Heck
2bb8bd3ec4 Signal need for reload of bibinfo cache rather than doing it. 2018-09-02 00:16:45 -04:00
Richard Kimberly Heck
a3e87dad80 Revert "Try yet again try to fix bug #9158."
(Unintentionally committed.)

This reverts commit 7b29d4e7aa.
2018-09-02 00:09:19 -04:00
Richard Kimberly Heck
7b29d4e7aa Try yet again try to fix bug #9158.
The problem with the previous attempt was that, every time through
updateBuffer, we looked up the file location using kpsewhich, which
took too long on Windows. The new solution is to cache that info, and
to look it up only when we need it.

Previously, this info would have been re-read whenever we parsed the
bibfiles. So we re-read it now whenever the bibinfo cache is invalid,
which is less often, but should be good enough. We can add more such
re-reads if need be.
2018-09-01 23:13:00 -04:00
Juergen Spitzmueller
bc644d131c Fix potential null pointer detected by Coverity 2018-09-01 10:45:03 +02:00
Juergen Spitzmueller
5279f3e11f Fix uninitialized value revealed by Coverity 2018-09-01 10:41:29 +02:00