Commit Graph

28239 Commits

Author SHA1 Message Date
Kornel Benko
441b0eab23 FindAdv: Amend 64af721a
The space handling is a nightmare.
2022-05-08 22:43:56 +02:00
Kornel Benko
64af721adc FindAdv: Handle normal and protected space also inside regular expression 2022-05-08 20:24:43 +02:00
Kornel Benko
286dcfc9c7 FindAdv: Correct the 'fix' in 4bb427a2
:(
2022-05-08 15:32:13 +02:00
Kornel Benko
4bb427a244 FindAdv: Amend 627cd6de: Use '~' instead of "\\ " for search if possible
Also fix a thinko in interpreting the found values.
The match_len describes the length of the second regex field,
while matchend is the length of the search field 0.
2022-05-08 14:30:45 +02:00
Kornel Benko
627cd6dec2 FindAdv: Simplify search for space also if not using regex
In the pattern-string convert occurences of
' ', '~'
and the values we get with
	space-insert normal
	space-insert protected
to "\s+".
2022-05-06 17:16:49 +02:00
Kornel Benko
70a762f91c FindAdv: Small improvements 2022-05-05 15:56:15 +02:00
Jean-Marc Lasgouttes
809a063358 Avoid crash when extending word selection
This happens when the cursor goes into a deeper inset, since
selectWord() was called on the wrong Text object.

Additionally, fix the new word selection when cursor goes before
existing selection.

Fixes bug #12529.
2022-05-05 11:13:29 +02:00
Kornel Benko
9f30de3c5d FindAdv: Partly revert 02c7dbb8. Handle the space in Paragraph.cpp instead. 2022-05-04 15:59:57 +02:00
Kornel Benko
02c7dbb824 FindAdv: Better handling of lists
Still not optimal if searching different languages inside a list.
2022-05-03 16:33:53 +02:00
Kornel Benko
6a70a26a4a FindAdv: Debug messages 2022-05-01 16:03:45 +02:00
Juergen Spitzmueller
c0a3d654ff Add GUI for search-ignore 2022-04-30 14:23:54 +02:00
Kornel Benko
cbe2f61396 FindAdv: Re-add 'size' to the list of possible ignored formats 2022-04-30 09:30:15 +02:00
Kornel Benko
48c069fa8a Amend a83159f0: Use logical operator ||.
Clang is not mocking here, but it looks more consistent.
2022-04-29 19:56:12 +02:00
Kornel Benko
531fed9543 FindAdv: Fix the length of leading string
We are removing leading values from the start of string, so
the size of removed data was wrong because s.find() could find
a position inside the leading part.
2022-04-29 19:23:50 +02:00
Scott Kostyshak
a83159f051 Fix Clang 14 warning -Wbitwise-instead-of-logical
Use the boolean operator '||' with bools instead of the bitwise
operator '|'.
2022-04-28 21:40:00 -04:00
Kornel Benko
769df229dc FindAdv: Avoid some duplicated code
Also handle (== ignore) \textgreek{} and \textcyrillic{} commands
2022-04-27 15:57:24 +02:00
Juergen Spitzmueller
e6a7137a53 Mark aliases in the description 2022-04-24 16:51:42 +02:00
Juergen Spitzmueller
64ec812da5 Amend d8f540f51
Properly handle aliases
2022-04-24 16:51:16 +02:00
Juergen Spitzmueller
d8f540f51b Properly ignore debug levels in the GUI
Not only none and any, but also the aliases.
2022-04-24 14:21:56 +02:00
Kornel Benko
98cc6acd0b Amend 3b7a79f1: Use Debug::base_type instead of 'unsigned long long' where possible 2022-04-24 13:52:46 +02:00
Kornel Benko
3b7a79f137 FindAdv: Amend d09f5ce1: Added new debug level :findverbose
Fix the GUI handling for the new value using now 'unsigned long long' instead of 'int'
2022-04-24 13:27:36 +02:00
Kornel Benko
c7b6bf4519 FindAdv: Search also if layout of the searched paragraph has 'inpreamble' set
Using 'force' in call to TeXOnePar() enables the search of any string in document.
2022-04-23 20:33:47 +02:00
Kornel Benko
e774ec1876 FindAdv: Fix search for '}'
Problem occured if
1.) not using regex and
2.) search without format and
3.) the search pattern ended with '}'.

then this last char '}' in the search pattern was discarded.
2022-04-19 23:28:27 +02:00
Juergen Spitzmueller
9318f1b338 Improve string 2022-04-19 15:12:56 +02:00
Kornel Benko
d09f5ce1d0 FindAdv, Debug: Added new debug level :findverbose
With the debug-level 'find' there are now less output.
The original output can be received now with debig-level 'findverbose'

Also constructions like
 LYXERR(Debug::FIND|Debug::FINDVERBOSE, "...");
are now possible.
2022-04-19 13:41:38 +02:00
Jean-Marc Lasgouttes
50403c4ecf Improve selection when selecting out of inset by the left
1/ put cusror in some display inset
2/ use shift-left until the cursor exits the inset
3/ see how the selection extends on the right.

This is not really a selection drawing bug, but rather the fact that
the anchor will be normalized to the first position after the inset,
which is in the next row.

This can be avoided by using the boundary property.

See discussion in bug #12520.
2022-04-18 18:17:56 +02:00
Pavel Sanda
335f158896 * RELEASE-NOTES 2022-04-17 00:49:35 +02:00
Pavel Sanda
a4f5f245f8 forgotten bit 2022-04-17 00:38:17 +02:00
Pavel Sanda
02ffd6dd70 Allow syncing open/close status of branch inset with it's activation status.
This was kicked out by 742b39f4 (the code in inset toggle survived).
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg217311.html
2022-04-17 00:16:19 +02:00
Kornel Benko
28b206665f FindAdv: Convert '\%' in a regex to '%'
Regex contents comes from handling hullRegexp, so we
have to reverse some its handling, among others also for the char '%'
2022-04-16 15:10:33 +02:00
Kornel Benko
45756a50b4 FindAdv: Handling of '%' in searched string while not ignoring format
Difficult to decide, when to remove the sequence '%\n'.
The sequence is OK for latex output as a command separator,
but must be removed in searched string.

Alas, not all occurences are wrong. Sigh.
2022-04-15 17:09:08 +02:00
Kornel Benko
c2229d388b Find: Renamend for_searchAdv to for_serach in src/OutputParams.h
Since this variable is used by quick find too, the naming was misleading
2022-04-12 18:02:12 +02:00
Kornel Benko
8338d1032d FindQuick: Amend 4bd38d8a: Remove now unneeded code 2022-04-09 09:11:38 +02:00
Kornel Benko
4bd38d8a09 FindQuick: Handle quotes special (as in findadv) 2022-04-09 08:52:24 +02:00
Kornel Benko
801768af92 FindQuick: Amend 1f7d90d6: Add some not handled quotation marks 2022-04-08 19:59:55 +02:00
Jean-Marc Lasgouttes
7cb700bf67 Fix crash with countExpanders in Qt6
It is not a good idea to contruct a QChar from a char_type that is
really 32bits.

Use lyx::isSpace, which already catters for this case.

Since this code does not depend on qt anymore, move it to
support::countExpanders.

Get rid of Row::countSeparators, which is not used anymore.

Fixes bug #12519.
2022-04-08 12:14:41 +02:00
Kornel Benko
1f7d90d636 Find: Advanced + Quick:
Expand list of quotes to include also '» « › ‹'
Enable quick find to search for quotes too
2022-04-08 08:40:32 +02:00
Kornel Benko
aa66663364 FindAdv: Amend 58f70b9d
Consider plain-quotes, inner-quotes
1 independent if in regex or text
2 independent of quote style
3 independent of using dynamic marks
2022-04-06 19:00:20 +02:00
Kornel Benko
58f70b9da1 FindAdv: Handle search for quotes
Double quotes will be found if using the string '"' in pattern.
Single quotes needs "'" in pattern.
2022-04-05 17:04:51 +02:00
Juergen Spitzmueller
31ac9ed59f Fix indentation 2022-04-04 12:02:25 +02:00
Juergen Spitzmueller
bbf21502bf Initialize member 2022-04-04 11:43:55 +02:00
Kornel Benko
681334ce20 FindAdv: Amend 6e7fd68c: Handle InsetNoteParams::Comment too 2022-04-04 10:46:55 +02:00
Kornel Benko
6e7fd68c79 FindAdv: Allow to search in LyX-Note also if ignoring format 2022-04-03 19:03:47 +02:00
Kornel Benko
c559b69fe1 FindAdv: Amend 4125f6a9
Variables regexError and regexError only defined
when searching via QT-version >= 5
2022-04-03 18:05:15 +02:00
Kornel Benko
4125f6a9d3 FindAdv: Omit possible empty patterns
Normally this is done by the GUI, but searching for e.g. LyX-Comment
allows empty patterns.
2022-04-03 13:21:02 +02:00
Thibaut Cuvelier
26300c565f MathML: fix validity for fractions with units.
https://www.lyx.org/trac/ticket/12513

Contributed by lynx.
2022-04-03 03:00:03 +02:00
Kornel Benko
4feb6aaea9 Make clang happy
Omitting 'error: comparison of integer expressions of different signedness'
2022-04-02 17:01:02 +02:00
Juergen Spitzmueller
0ab862f942 Amend d96135a9dc 2022-04-02 12:05:18 +02:00
Juergen Spitzmueller
d96135a9dc Amend bcad19e504
Allow searching in notes and comments if non-output-content is true
2022-04-02 11:19:55 +02:00
Thibaut Cuvelier
50374e38e1 XHTML/CALS tables: create helper functions to share more code. 2022-04-02 03:34:33 +02:00
Thibaut Cuvelier
88f767e492 CALS tables: base implementation of row separators on the new code from XHTML. 2022-04-02 03:34:33 +02:00
Thibaut Cuvelier
8b9c162f51 CALS tables: fix implementation of multirow/col. 2022-04-02 03:34:33 +02:00
Thibaut Cuvelier
544adb065b XHTML tables: fix borders and implement booktabs.
https://www.lyx.org/trac/ticket/10154

Contributed by raccoon.
2022-04-02 03:34:33 +02:00
Thibaut Cuvelier
838157392a XHTML/DocBook tables: slight refactoring. 2022-04-02 03:34:33 +02:00
Thibaut Cuvelier
72f630cb8f DocBook: remove unused variable. 2022-04-02 03:34:32 +02:00
Thibaut Cuvelier
5488bebb30 XHTML/DocBook: merge code paths to generate a row in a table. 2022-04-02 03:34:32 +02:00
Thibaut Cuvelier
fa5db30d41 Remove debug output. 2022-04-02 03:34:32 +02:00
Kornel Benko
bcad19e504 FindAdv: Handle latex-output for comment-environment
Disable if in search-adv modus and not searching in not-printed contents,
enable otherwise
2022-04-01 20:14:47 +02:00
Kornel Benko
83e65161a8 FindAdv: Ignore comment-feature (but not its content)
TODO: Handle 'comment' like other features, but this needs more thinking.
2022-04-01 13:45:57 +02:00
Juergen Spitzmueller
1aa449785e Indentation 2022-04-01 11:34:26 +02:00
Thibaut Cuvelier
0ba1b68f69 DocBook: merge code duplicates for HTML and CALS tables. 2022-04-01 04:21:31 +02:00
Thibaut Cuvelier
ec01616247 XHTML/DocBook: merge code duplicates for horizontal alignment. 2022-04-01 04:01:40 +02:00
Thibaut Cuvelier
c7896cf922 XHTML/DocBook: merge code duplicates for vertical alignment. 2022-04-01 03:51:24 +02:00
Thibaut Cuvelier
7b6afb23ec MathML: fix underbraces to be stretchable.
Ticket: https://www.lyx.org/trac/ticket/12502

Contributed by lynx
2022-04-01 00:01:42 +02:00
Kornel Benko
570be4760b FindAdv: Amend a0daf5e5
1.) Completed non backslashed '{' and '}' in regex in non format-search
2022-03-31 11:39:46 +02:00
Kornel Benko
a0daf5e551 FindAdv: Optimizing
1.) Handle backslashed '{' and '}' in regex also in non format-search
2.) Simplify a complex regex in format-search
2022-03-30 22:15:22 +02:00
Kornel Benko
6888c26706 FindAdv: Amend 23fe87bf:
Write one line of code and produce 10 new errors :(
2022-03-29 18:00:13 +02:00
Kornel Benko
23fe87bfc9 FindAdv: Amend f78ddc49, Added handling of accented chars like \ddot{a}
Only important for search without format. The format search was already OK.
2022-03-29 17:25:29 +02:00
Scott Kostyshak
77fd682acb Doc for inset-forall: how to open branch insets
The functionality was mentioned, but it seems worth it to give the
command explicitly, so it is seen how "Branch:<branch name>" is used
to refer to the specific branch with name <branch name>.

Additionally, tweak a phrase in doc for buffer-forall.
2022-03-28 21:48:59 -04:00
Kornel Benko
f78ddc49ad FindAdv: Amend 93b6fe2c, forgot about uppercase greek symbols 2022-03-27 13:43:42 +02:00
Kornel Benko
93b6fe2c48 FindAdv: Use always converted latex macros
In some situation the macros are not used with their unicode
representation. For instance all greek characters are used
as \alpha, \beta, ... in the latex output.
For the search it is more convenient to use the corresponding UTF-8 codes.
2022-03-26 19:32:33 +01:00
Kornel Benko
49c52d4c8e Indentation 2022-03-22 10:43:23 +01:00
Kornel Benko
e6d998d33c FindAdv: If possible use unicode instead of math command when searching
Wrong behaviour before this commit:
Open new lyx-file
insert
	unicode-insert 0x025c 0x1d08
Open adv-find dialog
search for unicode 0x025c OK
search for unicode 0x1d08 OK
search with regex for unicode 0x025c OK
search with regex for unicode 0x1d08 ==> NOT OK (because we are searching for \textrevepsilon
	and this was mapped to 0x025c
2022-03-20 11:33:12 +01:00
Jean-Marc Lasgouttes
307a2f91ad Revert part of 503c7c16: InsetMathNest:edit resets anchor.
Fixes bug reported here:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg217265.html

1. Start a new document.
2. Start a math inset and inside put "1+2".
3. Put the cursor to the right of "+".
4. Press <Shift> + L three times. This will select the entire math inset
   (as expected).
5. Press <Shift> + R.

Before 503c7c16, the selection inside the math inset was preserved.
After 503c7c16, it is lost.

The problem is that InsetMathNest does too much for our needs and
resets the anchor (why, I do not know). Therefore, it is better to
duplicate the code.
2022-03-17 17:02:23 +01:00
Juergen Spitzmueller
b9ca608c2f Properly color red checkbox labels in validation (part of #12508) 2022-03-17 08:47:43 +01:00
Juergen Spitzmueller
a89ff030cf Amend 0f80de308c 2022-03-17 08:16:54 +01:00
Juergen Spitzmueller
0f80de308c 0 is a plausible intermediate length in positive context (#12508) 2022-03-17 08:15:09 +01:00
Kornel Benko
2e9c962a24 FindAdv: Generalize substitutions of commands to unicode inside regex 2022-03-16 13:46:24 +01:00
Kornel Benko
9bef4f9f1a Amend f8071449: Added conversion for unicode 0x2bb
Now regex using \textquoteleft works also without format search.
2022-03-15 13:01:51 +01:00
Kornel Benko
f80714497b FindAdv: Added conversion for unicode 0x2bb
In math-mode \textquoteleft was still not used as unicode
so it was not possible to find the char using regex
2022-03-15 10:35:22 +01:00
Daniel Ramoeller
f21899661a Add toggle feature for all, outer and inner borders
Fix for bug #12503.

Also some bug fixes for the set inner lines algorithm. See discussion of #12503.
2022-03-13 10:34:16 -04:00
Juergen Spitzmueller
a88f67ac60 Fix signal (#12506) 2022-03-13 10:26:26 +01:00
Jean-Marc Lasgouttes
dc502c8279 Fixup 12dfdbf0: intercept validate(), not latex()
The fake contents of the inset should be created before validate(), so
that the correct packages are loaded.
2022-03-10 17:10:17 +01:00
Jean-Marc Lasgouttes
a6db1383f5 Get rid of spelling and language marks in info inset
These are just annoying. Note that the language mark cannot currently
be specified in a layout file, but it is not clear that there is a
need for that. Therefore I used the simple and hackish way.
2022-03-10 13:35:45 +01:00
Jean-Marc Lasgouttes
12dfdbf0a3 Fix crash in InsetInfo when bindings change
This is actually a generic InsetInfo issue:

1/ the contents of the inset is computed in updateBuffer, so that it
   is available for drawing but also for latex output (think batch
   export). When it is called, it deletes the existing inner paragraph
   and replaces it by a new one

2/ metrics build a new Row object that represents to paragraph

3/ draw() relies on this information

Now, imagine that updateBuffer() is called after metrics(). This can
happen for many reasons, and does happen here (display a shortcut info
and change the shortcut file from cua to emacs).

This problem has been here forever, but is only visible now that the
(experimental) bookmark display code needs to read the underlying
paragraph id.

The solution is to compute the inset contents at metrics time. This
is done by moving the relevant code to a new standalone build() method
that is called in metrics() but also in latex().
2022-03-10 12:45:07 +01:00
Kornel Benko
498a5cd487 FindAdv: Added possibility to search also in deactvated branches
To include content of deactivated branches to the searched region
one has to use the lyx-funcion
	search-ignore non-output-content true
2022-03-10 10:51:02 +01:00
Pavel Sanda
b257e2999b Correct fix for search-ignore docs. 2022-03-08 21:51:41 +01:00
Jean-Marc Lasgouttes
d15a96d93d updateBuffer needs an undo group
Otherwise warning messages appear when loading a file that contains
missing modules, for example (which may require to adjust depths in
document).
2022-03-08 16:16:50 +01:00
Enrico Forestieri
955308de57 Amend 3f9e21b8
This avoids a compile error on cygwin.
2022-03-06 23:01:56 +01:00
Juergen Spitzmueller
1c2628b5de Do not try to access user_defined_bullet with nesting > 3
We only have 4 nesting labels available.

In the workarea, display a fallback label with deeper nesting.
2022-03-06 17:27:28 +01:00
Juergen Spitzmueller
b296941d90 Revert "Don't asssert on (too) deeply nested items"
This reverts commit 44d1756783.
2022-03-06 09:48:39 +01:00
Juergen Spitzmueller
44d1756783 Don't asssert on (too) deeply nested items
Use a fallback label instead.
2022-03-05 14:17:37 +01:00
Juergen Spitzmueller
ed2e242b1e Whitespace 2022-03-05 13:45:27 +01:00
Juergen Spitzmueller
c02fe70797 Use a more transparent lexic for bullet label functions 2022-03-05 09:00:47 +01:00
Juergen Spitzmueller
ad31043987 Remove unused function 2022-03-05 08:51:32 +01:00
Thibaut Cuvelier
ffc1976b97 Avoid copies of vectors. 2022-03-05 03:46:22 +01:00
Enrico Forestieri
8496b7dc9a Compile fix 2022-03-05 02:19:38 +01:00
Thibaut Cuvelier
422bb60a14 tex2lyx tests: set the encoding when reading a file, not all OSes default to UTF-8 2022-03-03 01:57:28 +01:00
Juergen Spitzmueller
b5b3f56abb Encoding::fromLaTeXCommand: properly record requirements when exiting early 2022-03-02 12:48:10 +01:00
Juergen Spitzmueller
0c73df6efb Revert "Adapt resulting lyx-file to amend 39c0b322 (changed tex2lyx output)"
This reverts commit 5e8969b597.
2022-03-02 12:30:16 +01:00