Commit Graph

1207 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
f643057779 Remove useless cursor parameter to global undo actions
Add a Cursor-less version of Undo::recordUndoBufferParams (we don't
use an optional arument to avoir #includ'ing Cursor.h).

The version with CursorData parameter has been kept for the case of
local dictionary lfuns that have some kind of locality.

Remove Cursor argument to Undo::recordUndoFullBuffer().
2024-06-20 17:25:25 +02:00
Richard Kimberly Heck
6484dce51b Fix bug #12934 2024-06-01 13:05:12 -04:00
Juergen Spitzmueller
6ef18c3583 Limit the nopassthurchars case in beamer to URL
and also generally extend to classes that provide hyperref
2024-05-20 08:26:03 +02:00
Jean-Marc Lasgouttes
2660df9b99 Move Lexer to support/ directory (and lyx::support namespace)
This requires quite a bit of trivial code shuffling.
2024-04-28 12:23:13 +02:00
Jean-Marc Lasgouttes
c1fd622c51 Sanitize cursors after a buffer has been reloaded
When a buffer is reloaded, its content may remain the same, but the
memory allocation is new, so that the inset pointers in cursors are
now wrong. This requires to sanitize the cursors held by the buffer
views.

Before the biginset branch, some full metrics computation call that is
now removed probably did that as a side effect. Now we have to be more
precise.

To this effect, introduce WorkAreaManager::sanitizeCursors() and use
it in Buffer::reload().
2024-04-16 23:48:01 +02:00
Jean-Marc Lasgouttes
1d1f95d2ed Reduce metrics updates from 4 to 1 when loading file
The number of metrics updates when loading file and showing it in a
new work area is unreasonable.

The first avoided call to updateMetrics() was an explicit resize in
BufferView::init(). Instead, an assertion is suppressed by exiting
early BufferView::processUpdateFlags() when BufferView::ready()
returns false. This is a new method introduced to factor in some
existing tests.

Two other metrics computations are avoided by setting the enclosing
View object busy() while creating the new tab. To make this work
properly, GuiWorkArea::scheduleRedraw has to return early in this
case.

When saving an unnamed document or invoking "Save as...", call
setBusy(false) earlier so that repainting occurs correctly.

Fixes bug #12976.
2024-04-05 13:06:26 +02:00
Juergen Spitzmueller
4cfa3488e5 Restore parent after buffer reload (#13031) 2024-01-19 09:09:28 +01:00
Richard Kimberly Heck
59b08c8171 Fix bug #13017.
The problem is caused by removing temporary aux, etc, files while
we are in the process of exporting. As Jürgen suggested, we really
do not need to remove these files until we are preparing to export:
They are not used internally. So now we just schedule the removal
and do it then.
2024-01-11 17:23:52 -05:00
Richard Kimberly Heck
2ad57dcb6b Preview formatted references in the work area.
Patch from Daniel Ramoeller <d.lyx@web.de>, fixed up by RKH.
2023-08-24 21:24:31 -04:00
Richard Kimberly Heck
57f284d9a8 Whitespace 2023-07-28 17:16:06 -04:00
Richard Kimberly Heck
5b2b0d5c76 Fix bug #12819.
Pop a warning and mark the buffer dirty if the file is deleted from disk.
2023-07-27 18:13:42 -04:00
Alexander Dunlap
c609e9cbcf Display equation/theorem numbers in insert cross reference dialog.
Fixes bug #11466,
2023-07-26 13:35:42 -04:00
Jean-Marc Lasgouttes
35359a4c6f Improve branch activatiion LFUNs
* put the code that is called both from Buffer and InsetBrach in the
  two helper methods Buffer::branchActivationStatus() and
  Buffer::branchActivationDispatch().

* Cleanup the code so that _MASTER_ lfuns are disabled when there is
  no master document.

* When changing branches in the master buffer, make the buffer visible
  if it is not, and make sure that undo information is recorded.

* The code in Buffer::dispatch is used first, and it gives control to
  the branch inset code if no branch name has been specified.

Fixes bug #12588.
2023-07-23 18:57:38 +02:00
Jean-Marc Lasgouttes
89db357cd6 Code factoring: introduce BufferView::busy()
The WorkArea should not have to look at details of the undo stack.
No change intended.
2023-05-03 11:57:31 +02:00
Pavel Sanda
6b7da5ec8c typo 2023-04-13 21:50:43 +02:00
Pavel Sanda
f664498ba7 typo 2023-04-13 21:36:17 +02:00
Juergen Spitzmueller
849d0c81ca Record babel use for single par preview 2023-04-02 14:51:47 +02:00
Pavel Sanda
9bbec4a75a Fix #12678. 2023-02-26 22:30:17 +01:00
Thibaut Cuvelier
861af2b84f LyXHTML: remove meta content-type, it is only for HTML5, not XHTML5 (LyX is generating XML-compatible HTML, i.e. XHTML5). 2023-01-11 01:12:22 +01:00
Thibaut Cuvelier
6a3bd64032 LyXHTML: use a lower-case meta for generator, this is the most common convention. 2023-01-07 16:24:57 +01:00
Thibaut Cuvelier
a5c6215ebd LyXHTML: add a missing space in the content-type annotation. 2023-01-07 16:23:56 +01:00
Thibaut Cuvelier
fb4a26577e LyXHTML: don't explicitly mention that the style is CSS, HTML5 doesn't like it. 2023-01-07 03:42:11 +01:00
Thibaut Cuvelier
fd2078f3aa LyXHTML: remove the double specification of charset.
The choice of content-type is arbitrary.
2023-01-07 03:36:57 +01:00
Thibaut Cuvelier
cabb12ba51 LyXHTML: fix the content-type attribute, it must be lower case (enforced for HTML5). 2023-01-07 03:33:48 +01:00
Thibaut Cuvelier
26e6b1c209 LyXHTML and DocBook: encode language codes as BCP47. 2023-01-07 03:31:40 +01:00
Thibaut Cuvelier
ff2a2b2a8a DocBook: add a comment about the need for DocBook 5.2. 2022-12-25 20:48:26 +01:00
Thibaut Cuvelier
bc73a85778 LyXHTML: switch the doctype to (X)HTML5 and only output XML entities.
This is a new take on c8e2c17a that was reverted at da67bde61a due to entities no more recognised by the browsers. Corresponding thread on the mailing list: https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg213179.html

This patch is a huge cleanup overall, by removing the distinction between HTML and XML entities (the latter arrived due to the DocBook support).

In InsetListingParams, I also changed the mechanism that relied on &quot; to use an XML entity to be consistent with the rest of the code, mostly in case someone looks for HTML entities and wonders why they are still there.
2022-12-25 20:48:14 +01:00
Thibaut Cuvelier
d85969b8b8 LyXHTML: give the language in the root tag. 2022-12-25 20:48:14 +01:00
Juergen Spitzmueller
029adfa28c Improve LaTeX version checking
Instead of having to add and individually test the versions to check
for, we store the current version and test on that with a specific
function isAvailableAtLeastFrom(package, year, month, day)

Currently only used for the LaTeX version, but could also be extended
for package versions.
2022-12-19 15:15:41 +01:00
Juergen Spitzmueller
e26a60edef Regenerate previews after zoom (#11919) 2022-11-20 18:18:59 +01:00
Jean-Marc Lasgouttes
2c53f0315e Fix another use of unqualified std::move 2022-11-04 21:36:43 +01:00
Jean-Marc Lasgouttes
6c2d4f9392 constify 2022-10-28 18:03:50 +02:00
Enrico Forestieri
90551a03ac Amend f426470a
The synctex option can also be specified by a single dash and
any value different from zero will do.
2022-09-14 20:10:01 +02:00
Stephan Witt
f426470a54 Improved synctex support
- Add check for converter with active synctex support to check for synchronized output for activate forward search.
2022-08-13 14:20:03 +02:00
Jean-Marc Lasgouttes
96e7fcd4e0 When pasting as LaTeX, honor textclass and modules
There are several small parts that are needed here:

* Implement LayoutModuleList::asString() that returns a comma-separated
  list of modules.

* in Converter::convert(), handle the new tokens $$c for the current
  textclass and $$m for the list of modules.

* in Buffer::importFile(), pass the current buffer as parameter instead
  of nullptr.

* in pasteClipboardText(), copy the parameters of the current buffer to
  the internal one used for importation, so that the textclass and
  modules information is available to convert().

* finally, modify configure.py to pass "-c $$c -m $$m" to tex2lyx for
  the latexclipoard->lyx converter.

Fixes bug #11312.
2022-07-19 00:28:28 +02: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
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
c02fe70797 Use a more transparent lexic for bullet label functions 2022-03-05 09:00:47 +01:00
Thibaut Cuvelier
997f0621c5 Rename LATEX debug level to OUTFILE and use it for DocBook, HTML, and XML messages. 2022-03-01 16:05:42 +01:00
Juergen Spitzmueller
6c530e1215 Still more indentation fixes. 2022-02-28 08:04:55 +01:00
Daniel Ramöller
df59649a18 Properly show labels from broken references in Cross-references dialog
Fix for bug #12456.

The labels are transmitted from Buffer to GuiRef by reference of refs_
in the getLabelList function. Previously, only one string was
transmitted. But I needed both the formatted string, e.g. "x enu:test"
or "Missing: enu:test", as well as the plain label, e.g. "enu:test".
The former is for the list of labels to choose from in GuiRef and the
latter for the label as shown in the line edit that contains the plain
label in order to create a new reference from it. Transmitting both is
what the pair achieves.
2022-02-19 18:14:47 +01:00
Daniel Ramoeller
122b452b20 Display manually set itemize symbols
Display manually set itemize symbols and their size in the work area.

Fix for bug #2277.

Also fixes a problem with document settings changed() not correctly emitted.
2022-02-06 17:58:50 +01:00
Pavel Sanda
33c68d7750 Revert 65b674ba4e.
We do not for what crash was this fix intended, but we know
that the fix introduced freeze in xhtml exports (e.g. merged manual).

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg216835.html
2022-01-28 18:12:45 +01:00
Juergen Spitzmueller
e366dba9bf Factor out Buffer::requestSpellcheck() function 2021-11-25 17:04:17 +01:00
Thibaut Cuvelier
b5533a24f4 Typos and comment improvements. 2021-10-13 19:26:49 +02:00
Yuriy Skalko
d3c335a5d5 Remove useless casts reported by GCC with -Wuseless-cast option 2021-09-30 10:37:24 +03:00
Thibaut Cuvelier
de77854275 DocBook: fix MathML prefix in root tag.
Patch written by lynx: https://www.lyx.org/trac/ticket/12229
2021-05-24 23:55:11 +02:00
Jean-Marc Lasgouttes
c9146e5be0 Fixup f3a0e8ff: costly thinko
When the buffer stuff has been updated, the Buffer::needUpdate()
should be reset to false. This was forgotten in f3a0e8ff.

Fixes performance issues with MergedManuals, for example. UpdateBuffer
would be run again and again when selecting text.
2021-04-09 18:15:31 +02:00
Richard Kimberly Heck
eb2e8e1579 Polish 2021-04-03 17:58:46 -04:00
Pavel Sanda
9d1031771e Fix #4658: showing diff between original and emergency files.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg215796.html
2021-04-03 13:19:53 +02:00