Commit Graph

3693 Commits

Author SHA1 Message Date
Allan Odgaard
dfd4c1cd6f Remove unused reader subclasses 2016-06-13 13:02:49 +02:00
Allan Odgaard
a60e32b41a Draw selection in left/right margin when line is fully selected 2016-06-13 13:02:49 +02:00
Allan Odgaard
17574f3d0e Add crash log info to performDragOperation: 2016-06-13 13:02:49 +02:00
Allan Odgaard
c500e3073b Add document_t wrapper functions to document_view_t
This should make it possible to only deal with a document view (which retains the underlying document).
2016-06-13 13:02:49 +02:00
Allan Odgaard
18f4d8fc83 Minor simplification of document_view_t API 2016-06-13 13:02:49 +02:00
Allan Odgaard
3700332f3e Change how we obtain visible range for accessibility
This is so that we can remove the index_below function from document_view_t.
2016-06-13 13:02:49 +02:00
Allan Odgaard
a340811771 Allow access to buffer_t’s raw storage via the visitor interface
Previously this was done by exposing iterators but for this to go into the abstract base class we sort of need abstract iterators and that is too complex and visitor interface is sufficient for our single use case.
2016-06-13 13:02:49 +02:00
Allan Odgaard
b5747ec6a6 Return text::indent_t by value so we can create it on the fly 2016-06-13 13:02:49 +02:00
Allan Odgaard
43849342c6 Make find_gutter_view helper function private 2016-06-13 13:02:49 +02:00
Allan Odgaard
a88ef64c13 Move the undo grouping nest counter to document_view_t
This fixes a problem introduced by 3812a8d1fd3a5c4cf964f15ceeeca529238bc35b where we could end up not closing an undo group because the OakTextView’s document was changed before destruction of the refresh_helper_t.
2016-06-13 13:02:49 +02:00
Allan Odgaard
dcb306175c Limit information exposure 2016-06-13 13:02:49 +02:00
Allan Odgaard
d1bcb9f401 Simplify undo/redo API 2016-06-13 13:02:48 +02:00
Allan Odgaard
3747ee8e8f Rename a few member functions 2016-06-13 13:02:48 +02:00
Allan Odgaard
d544b38a33 Remove unnecessary method signature from OakTextView interface 2016-06-13 13:02:48 +02:00
Allan Odgaard
ca424bc504 Move reading of document specific settings to document_view_t 2016-06-13 13:02:48 +02:00
Allan Odgaard
fe84c5af48 Move document open/close management to document_view_t 2016-06-13 13:02:48 +02:00
Allan Odgaard
63b15949de Use member data variable instead of constructor argument 2016-06-13 13:02:48 +02:00
Allan Odgaard
d2259f7333 Don’t mirror wrap column instance data in OakTextView 2016-06-13 13:02:46 +02:00
Allan Odgaard
b2ce37f1c4 Add getter for a layout’s wrap column
Also rename wrapping member function to soft_wrap.
2016-06-13 13:01:11 +02:00
Allan Odgaard
9f1778f7a8 Remove document_view_t’s as_string member function 2016-06-13 13:01:11 +02:00
Allan Odgaard
4a4629e350 Add variables member function to document_view_t 2016-06-13 13:01:10 +02:00
Allan Odgaard
436405244e Use a unique pointer for document_view_t’s layout_t member 2016-06-13 13:01:10 +02:00
Allan Odgaard
b45212f73d Make document_view_t’s document instance private 2016-06-13 13:01:10 +02:00
Allan Odgaard
998c0da999 Pass document_view_t when a buffer_api_t type is required 2016-06-13 13:01:10 +02:00
Allan Odgaard
db5120c940 Add buffer_api_t conformance to document_view_t 2016-06-13 13:01:10 +02:00
Allan Odgaard
2ae0f41a10 Make write_unit_to_fd helper function work with buffer_api_t 2016-06-13 13:01:10 +02:00
Allan Odgaard
029dab73be Make to_xml a member function of buffer_t
We could implement this by using the public scopes member function though this function includes dynamic scopes such as misspelled ranges which would change the current semantics of the to_xml helper function.

It might actually make sense to make this change, but I’m avoiding functional changes while refactoring.
2016-06-13 13:01:10 +02:00
Allan Odgaard
36fedf5bee Change most buffer helper functions to accept buffer_api_t 2016-06-13 13:01:10 +02:00
Allan Odgaard
84ef816ec3 Introduce a buffer_api_t abstract base class
This allows us to use the various helper functions (mainly found in the selection library) with alternative buffer implementations.
2016-06-13 13:01:10 +02:00
Allan Odgaard
9dc2eb0aee Make refresh_helper_t’s document requirement explicit 2016-06-13 13:01:10 +02:00
Allan Odgaard
0a58c4e44d Make document_view_t’s layout and editor instances private 2016-06-13 13:01:10 +02:00
Allan Odgaard
857ce3a2e1 Pass document_view_t to items_for_tab_expansion 2016-06-13 13:01:09 +02:00
Allan Odgaard
14eb6fdca4 Add refresh cycle wrappers to document_view_t 2016-06-13 13:01:09 +02:00
Allan Odgaard
18eb5b98a8 Remove layout_t argument from document_view_t::perform 2016-06-13 13:01:09 +02:00
Allan Odgaard
424f396c86 Add document_t::set_indent wrapper to document_view_t 2016-06-13 13:01:09 +02:00
Allan Odgaard
c1c92e21c1 Add namespace qualifier to some helper functions
This should make their origin more clear.
2016-06-13 13:01:09 +02:00
Allan Odgaard
e77049d55f Add buffer_t::operator[] wrapper to document_view_t 2016-06-13 13:01:09 +02:00
Allan Odgaard
7d7914c46b Add undo_manager_t wrapper functions to document_view_t 2016-06-13 13:01:09 +02:00
Allan Odgaard
03529a0184 Add buffer_t wrapper functions to document_view_t 2016-06-13 13:01:07 +02:00
Allan Odgaard
9be3c12879 Add editor_t wrapper functions to document_view_t 2016-06-13 13:00:39 +02:00
Allan Odgaard
3d175d3ff7 Add layout_t wrapper functions to document_view_t 2016-06-13 13:00:37 +02:00
Allan Odgaard
f7e61679b9 Add missing space (coding style) 2016-06-13 13:00:04 +02:00
Allan Odgaard
2a0a3b6172 Pass document_view_t to refresh helper instead of its members 2016-06-13 13:00:04 +02:00
Allan Odgaard
84d83c93ed Introduce wrapper for editor_t and layout_t
This is first step toward consolidation of document_t, buffer_t, editor_t, and layout_t.
2016-06-13 13:00:00 +02:00
Allan Odgaard
10e6527eaa Remove unused indentCorrections property from OakTextView
The intent was to expose indent settings via the UI which is still a goal, but we’ll do a lot of refactoring first, so removing unused public API to make refactoring simpler.
2016-06-13 12:59:31 +02:00
Allan Odgaard
b59dee8e6d Use semantic assertion 2016-06-13 12:59:31 +02:00
Allan Odgaard
02a5747f89 Ignore /usr/bin/git if /usr/bin/xcode-select -p fails
On recent OS versions the /usr/bin/git executable will prompt the user to install git (if Xcode is not already installed) which can cause some user confusion, so we now avoid using /usr/bin/git unless Xcode is installed.
2016-06-13 12:59:31 +02:00
Allan Odgaard
c136a21804 Use indexed_map_t to track foldable lines
It is not clear to me whether there was a reason that this code was using the basic_tree_t directly or if it was just written before the indexed_map_t layer was introduced.
2016-06-13 12:59:31 +02:00
Allan Odgaard
ec42982b13 Simplify code to setup folding patterns 2016-06-13 12:59:31 +02:00
Allan Odgaard
39a7d5a867 Do not prevent coalescing last edit when redoing it
We always undo the last edit without any coalescing so the user can be sure that ⌘Z only undos the last thing they did. For redo though this makes less sense, although it does break symmetry, i.e. pressing ⌘Z n times will bring us back again by pressing ⇧⌘Z only n-1 times.
2016-06-13 12:59:31 +02:00