Commit Graph

32 Commits

Author SHA1 Message Date
jkobus
33a7952745 Implement syntax highlighting in diff editor
All Qt Creator's main highlighters are used in the first place,
for other mimetypes generic highlighter is used as a fallback.

Task-number: QTCREATORBUG-9580

Change-Id: I863b9085520e5bdda142ce88f2074afeacee0531
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
2013-08-29 08:54:04 +02:00
Orgad Shaneh
ad9e7ccab6 Fix coding style for else statements
Change-Id: I1309db70e98d678e150388c76ce665e988fdf081
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-17 11:11:25 +02:00
Eike Ziller
624d9e2c4c Move IEditor::isTemporary to IDocument
It's a property of the document implementation, not of the specific
editor instance working on it.

Change-Id: I5c3dd054e21b646e2d94b891916a096d045923f8
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-12 16:43:54 +02:00
jkobus
c59c1661d1 Fix jumping to wrong line after double click in left view
Task-number: QTCREATORBUG-9655

Change-Id: Ide2a68e4d49b0bb17d745e7f13f1c565b8629c03
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-05 09:43:08 +02:00
jkobus
2b3d38b426 DiffEditor: double click doesn't select the current word
Task-number: QTCREATORBUG-9381

Change-Id: Icc96c31b029d978c23a44fca59bcc28891fd92c6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2013-07-01 13:33:53 +02:00
jkobus
b5be527eb9 DiffEditor: Show tooltips with filenames
Change-Id: I32af3b310deb4c96bf1dc798392029cc361ced97
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-06-19 09:12:49 +02:00
jkobus
abe3951d67 Take diff colors from color scheme
Change-Id: I706612a8f89917cb57b7d1e9ecebd86b3f4bcc8d
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-06-12 09:23:50 +02:00
jkobus
2ddcc0c386 Fix wrong diff output with span lines
Task-number: QTCREATORBUG-9494

Change-Id: Ica26e1448b1997e102648be58128f1be00c4905e
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2013-06-07 15:36:55 +02:00
Eike Ziller
7c8db79817 Switch less often to edit mode
This change
* Removes IMode::type, ModeManager::activateModeType, and
  IEditor::preferredModeType, and adds IEditor::isDesignModePreferred
  instead
* Adapts the mode switching code in EditorManager to handle multiple
  windows, for example switching to edit mode should only happen if
  the editor/view is in the main window. Otherwise the editor window
  should be raised and focused
* Renames EditorManager::NoActivate --> DoNotChangeCurrentEditor
* Reverts the EditorManager::ModeSwitch logic to switch mode or
  make the current editor visible by default, introducing
  DoNotMakeVisible flag instead
* Fixes a few instances where EditorManager::ModeSwitch should have been
  used

One non-trivial problem left: If you open a .ui file and switch to an
external editor window, edit mode is activated, because the current
editor no longer is a .ui file, which means that the design mode gets
deactivated.

Change-Id: I76c5c2391eb4090143b778fb103acff3a5a1ff41
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-06-05 09:43:14 +02:00
jkobus
aa0533c969 Move "Sync Horiz Scroll Bars" corner widget to the toolbar
Change-Id: Ie97ae07b02499b4d8d80e006aa77ca3b802f39b3
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-06-04 11:14:06 +02:00
jkobus
26142b849b DiffEditor: Apply visualize whitespaces according to options
Change-Id: I5f7c57479d5342f5457159b14fb6afa087cb988f
Reviewed-by: Marcel Krems <m.krems@software-vision.eu>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-06-04 10:56:48 +02:00
hjk
daad8e238e Editors: Provide a base implementation for duplicate{,Supported}
Helps avoiding trivial re-implementations.

Change-Id: Iaa2e6b92503a2b9553432568c2047c28899c7ea6
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-05-27 14:27:16 +02:00
jkobus
569d29dc3e Use minisplitter inside diff editor
Change-Id: Ia2388e8c50185f80111fcf96aedb8143088e9a1c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
2013-05-26 20:13:41 +02:00
jkobus
74604a231d React to fontSettingsChanged inside diff editor
Change-Id: I72e5cd61ea67d87a3f82843ee1f3b42d13142dff
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-05-26 20:13:37 +02:00
jkobus
2ddb726dd5 Add file list combobox to diff editor
Change-Id: I2a40207ed3c4a5c07ba544d681aed6649a0b1a11
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-05-24 14:14:06 +02:00
jkobus
b8acf23ec4 Synchronize horizontal scroll bars in diff editor
Synchronize horizontal scroll bars by default.
Added corner widget to toggle synchronization off.

Change-Id: I52316f1d9399b9ad21a346d65873b37ce0a9b98f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2013-05-23 11:53:23 +02:00
jkobus
8311e20246 Fix highlight artifacts in diff editor
Which appeared after pressing "..." mark and scrolling right.

Change-Id: I779d4a7e76ebb01857d7313b5099a5482c455136
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2013-05-22 16:15:33 +02:00
jkobus
55717e1167 Respect tab settings in diff editor
Currently it's not possible to respect language specific tab
settings in diff editor. It can happen that one view
contains C++/Qt Quick files, while tab settings
are common for the whole view.

Change-Id: I45c6113afd7d41667b68a4daba0ac0fa4472b4e9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2013-05-22 11:19:34 +02:00
jkobus
97a86c50dc Basic integration of diff editor inside git plugin
Change-Id: I7675fc1d994020f94f42f6bd7b4f75aa29e6edf6
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-05-15 16:24:38 +02:00
jkobus
20625d5498 Implement jumping to original file on double click
Change-Id: I25f2624df65826b93604ff7df2485162691498d0
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-05-07 10:55:56 +02:00
jkobus
e844bee1da Add file descriptions, enable file folding
Change-Id: Ie90ac9fb74e9c4b8cfba16d065d1b8751125e83c
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-05-06 10:31:54 +02:00
jkobus
895b89dbdf Fix a crash on changing context lines with block selection
Crash occurs in diff editor when there is a block selection
and you are changing context lines number.

This workarounds the crash, but it seems that
when BaseTextEditorWidget has a blockSelection
calling "clear()" and "setPlainText()"
causes the crash. When I turn off the
blockSelection before calling "clear()" it helps.

Change-Id: I0133862a2d7e2914c16368b7efa9986b4d56ff39
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-04-24 15:31:32 +02:00
jkobus
ce0efbda46 Omit separator lines when copying selected text
In addition rename int start -> startPosition and int end -> endPosition
to avoid a name clash with QTextBlock start inside
BaseTextEditorWidget::createMimeDataFromSelection().

Change-Id: I7f54e4046913b5d5d9ddd3c07fd2747b4ca6f3fb
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-04-24 13:17:53 +02:00
jkobus
5219faf0e2 Refactor code
Create a common method for a similar code.
Simplify some logical operations.

Change-Id: If25703c51ea96fe5a64698f6fa3ffd6f5cb1b2c5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-04-23 16:35:22 +02:00
jkobus
5f5b7fa4c1 Remove unused variables
Remove unused fields and one virtual method,
rename alwaysShows -> contextChunk and revert
its logical value.

Change-Id: I11fd60202aa5b7978b772764a40c99029cac82a3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-04-23 14:33:33 +02:00
jkobus
186c457d6c Implement expanding / shrinking skipped lines
Change-Id: I6921b7a39288f6a9747574b1a8e75d571f4723ce
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-15 18:09:35 +02:00
jkobus
77abd02787 Get rid of QChar::LineSeparator
It was causing troubles while scrolling. Replace it with
\n and hack selection. Simplify the code. Now every line
is a separate block. Prepare for expanding skipped lines.

Change-Id: I8d305681c575abdaaf9cdbf26de864dd3a906d3a
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-12 14:55:08 +02:00
jkobus
41fa8c3528 Add cleanupSemantics method, produce nicer diff output
Change-Id: I877e06c930c219ad23af4b7c6078d8c8db3706e9
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-14 09:36:15 +01:00
jkobus
4c75dd71ed Optimize painting of skipped lines, don't paint "..."
Change-Id: I4a803ca899438ea0067c9a6244dffc77bc7109dd
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-07 00:47:14 +01:00
jkobus
9abb8563e3 Standardize IEditor subclass names, don't capitalize namespaces
Change-Id: I13ac8d4286b292c03019a7a564feee2c36475bf9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-22 11:39:22 +01:00
Friedemann Kleint
6d3c271d53 Rename namespace DIFFEditor to DiffEditor.
Change-Id: Ia87098de61f38530806e1cf87b69d0bfc66e250c
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-02-21 17:13:06 +01:00
jkobus
0e91d10878 Experimental integration of DiffEditor
After enabling the plugin go to Tools|Diff...

Change-Id: I793b6faedb93f58039df0a62e82fe04a017978ee
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-02-18 18:15:51 +01:00