Age | Commit message (Collapse) | Author |
|
|
|
This patch allows Blender to display i18n monospace font in the text
editor and the Python interactive console. Wide characters that occupy
multiple columns such as CJK characters can be displayed correctly.
Furthermore, wrapping, selection, suggestion, cursor drawing, and
syntax highlighting should work.
Also fixes a bug [#34543]: In Text Editor false color in comment on cyrillic
To estimate how many columns each character occupies, this patch uses
wcwidth.c written by Markus Kuhn and distributed under MIT-style license:
http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
wcwidth.c is stored in extern/wcwidth and used as a static library.
This patch adds new API to blenfont, blenlib and blenkernel:
BLF_get_unifont_mono()
BLF_free_unifont_mono()
BLF_draw_mono()
BLI_wcwidth()
BLI_wcswidth()
BLI_str_utf8_char_width()
BLI_str_utf8_char_width_safe()
txt_utf8_offset_to_column()
txt_utf8_column_to_offset()
|
|
autocomplete is now unicode aware, using python api's checks for now. eventually we should have our own.
|
|
clicking a pair chars would select 3 - one to the left).
|
|
Issue was caused by couple of circumstances:
- Normal Map node requires tesselated faces to compute tangent space
- All temporary meshes needed for Cycles export were adding to G.main
- Undo pushes would temporary set meshes tessfaces to NULL
- Moving node will cause undo push and tree re-evaluate fr preview
All this leads to threading conflict between preview render and undo
system.
Solved it in way that all temporary meshes are adding to that exact
Main which was passed to Cycles via BlendData. This required couple
of mechanic changes like adding extra parameter to *_add() functions
and adding some *_ex() functions to make it possible RNA adds objects
to Main passed to new() RNA function.
This was tricky to pass Main to RNA function and IMO that's not so
nice to pass main to function, so ended up with such decision:
- Object.to_mesh() will add temp mesh to G.main
- Added Main.meshes.new_from_object() which does the same as to_mesh,
but adds temporary mesh to specified Main.
So now all temporary meshes needed for preview render would be added
to preview_main which does not conflict with undo pushes.
Viewport render shall not be an issue because object sync happens from
main thread in this case.
It could be some issues with final render, but that's not so much
likely to happen, so shall be fine.
Thanks to Brecht for review!
|
|
|
|
- make the popup box line up the X axis with the current word.
- add poll function for the operator
|
|
|
|
|
|
new image. (not use existing one)
|
|
|
|
|
|
Submitted by: Justin Dailey (dail)
Patch allows the current line (or selected lines) to be moved up and down with
Ctrl+Shift+Up and Ctrl+Shift+Down. Has undo/redo support and operators in python
menu.
|
|
from Justin Dailey (dail)
made this Ctrl+D, to replace Delete.
|
|
|
|
added some missing functions too - which are not used yep but should be there for api completeness.
* CDDM_set_mloop
* CDDM_set_mpoly
* BLI_mempool_count
|
|
without the underscores these clogged up the namespace for autocompleation which was annoying.
|
|
|
|
This also fixes cursor movement in the beginning of line and adds do_versions block for converting text files with old extended ascii encoding into UTF-8.
|
|
also removed some unused function definitons.
|
|
http://markmail.org/message/fp7ozcywxum3ar7n
|
|
click on header not working
also get rig of more shadowed vars (-Wshadow).
|
|
Added new option to find panel of space text which toggles
case-esensitive search.
Additional changes:
- Send NC_TEXT|NA_EDITED when removing markers in find_and_replace modifier
this prevents "sticked" markers which disappears on first redraw when
search text wasn't found
- Do not show "Text wasn't found" error when text to be searched is contained
in the end of buffer and it's selected. Replacing/marking used to happen, but
this popup message was really annoying for this case.
TODO: It's incorrect to use UI_GetThemeColor4ubv from this operator
|
|
This bug was caused by tabs->spaces conversion. Change pate-ing logic to
paste buffer AS-IS (without any conversions).
This commit also fixes undo-ing block deletion which contains tabs when
"Tabs as spaces" is toggled on. Also, markes shouldn't be moved after
pasteing new buffer.
|
|
|
|
- made theme colors for mesh edge len & face angle/area display.
- use %g rather then %f for float display, trims unneeded zeros.
- store cached 2d and 3d text color as bytes rather then floats, compare when drawing to avoid setting the context.
- use unsigned char for more color functions, avoids casting to glColorubv().
|
|
flagged as PROP_THICK_WRAP.
Also use const char in many other parts of blenders code.
Currently this gives warnings for setting operator id, label and description since these are an exception and allocated beforehand.
|
|
from Fabian Fricke (frigi)
|
|
|
|
- Commands from the history wont get modified in-place when you cycle back and re-use them.
- Ctrl Left/Right skip words.
- Autocompletion on a variable that has no alternatives adds a '.'
'bpy' -> 'bpy.', generally more useful since autocomp again will give the members of bpy
also moved text_check_* functions into BKE_text.h for the console to access.
|
|
writes all operators (including PyOperators) and their default values into a textblock.
Useful for an overview and checking consistancy.
eg. http://www.pasteall.org/7918/python
added rna functions text.clear() and text.write(str)
|
|
Make local and make single user are back for ID template.
Internally these calls got unified, id_make_local and
id_copy are now used to do these operations for all types
that support it. Also reveals that for some ID types the
implementation is still missing.
Further, some small changes:
* unlink_text is now in blenkernel.
* copy_group was implemented.
* ID template now has an open operator again.
* fix preview to not change material reference count,
even if temporary it shows up with threaded preview.
* id_unlink unifies unlink for text, object and group.
|
|
There was very little structure in this code, using many globals
and duplicated code. Now it should be better structured. Most
things should work, the main parts that are not back yet are the
python plugins and markers. Notes:
* Blenfont is used for drawing the text, nicely anti-aliased.
* A monospace truetype font was added, since that is needed for
the text editor. It's Bitstream Vera Sans Mono. This is the
default gnome terminal font, but it doesn't fit entirely well
with the other font I think, can be changed easily of course.
* Clipboard copy/cut/paste now always uses the system clipboard,
the code for the own cut buffer was removed.
* The interface buttons should support copy/cut/paste again now
as well.
* WM_clipboard_text_get/WM_clipboard_text_set were added to the
windowmanager code.
* Find panel is now a kind of second header, instead of a panel.
This needs especially a way to start editing the text field
immediately on open still.
* Operators are independent of the actual space when possible,
was a bit of puzzling but got it solved nice with notifiers,
and some lazy init for syntax highlight in the drawing code.
* RNA was created for the text editor space and used for buttons.
* Operators:
* New, Open, Reload, Save, Save As, Make Internal
* Run Script, Refresh Pyconstraints
* Copy, Cut, Paste
* Convert Whitespace, Uncomment, Comment, Indent, Unindent
* Line Break, Insert
* Next Marker, Previous Marker, Clear All Markers, Mark All
* Select Line, Select All
* Jump, Move, Move Select, Delete, Toggle Overwrite
* Scroll, Scroll Bar, Set Cursor, Line Number
* Find and Replace, Find, Replace, Find Set Selected,
Replace Set Selected
* To 3D Object
* Resolve Conflict
|
|
Think global, act local!
The old favorite G.scene gone! Man... that took almost 2 days.
Also removed G.curscreen and G.edbo.
Not everything could get solved; here's some notes.
- modifiers now store current scene in ModifierData. This is not
meant for permanent, but it can probably stick there until we
cleaned the anim system and depsgraph to cope better with
timing issues.
- Game engine G.scene should become an argument for staring it.
Didn't solve this yet.
- Texture nodes should get scene cfra, but the current implementation
is too tightly wrapped to do it easily.
|
|
|
|
of using flags). The lower two bytes of the group are used for python scripts while the upper two (or more) are reserved for internal grouping. Plenty either way.
|
|
then other markers follow.
|
|
a blockhandler panel. The panel is shown when find is invoked with Alt F (or from the menu). Successive presses of Alt F search again, while the panel is visible. Alt H does the same for replace. (Ctrl F and Ctrl H also work - more like other editors)
|
|
avoid getting in the way. If there is a marker under the cursor, ESC will remove it and others in its group. Otherwise all temporary markers are removed. Tab finds/cycles/removes temp. markers, cycles non-temp. markers (under cursor) and behaves normally in all other cases.
|
|
string and allows them to be edited from one instance. Improvements have also been made to the UI allowing better control over which occurrences to replace.
|
|
relationships. They allow portions of text to be edited as one and enable quick jumping between and editing of different areas.
Flags control the behaviour and grouping of markers. At present, Ctrl+M places a marker with TMARK_EDITALL set for testing purposes.
I have also split the text area event handler into separate methods for marker handling and the existing text tools. This makes the events system much easier to follow as it was getting a little hairy.
|
|
- Added GUI panel
- Selected text is copied to "find" field
- Option to search "all texts"
- Option to replace text
- Alt+F finds, Ctrl+Alt+F finds again (without UI)
- Alt+H replaces (UI), Ctrl+Alt+H replaces again (and undo works)
- Fixed: Find didn't push undos so cursor position was wrong
|
|
inserting text. It seems Text.write() actually inserts *then* moves to the end of the buffer, so it doesn't really append as it says in the docs. However, with these new functions both appending and inserting can be achieved.
|
|
* Alt-Left/Right: moves cursor/selection a word to the left/right
* Alt-/Ctrl-Delete/Backspace deletes whole words at a time
|
|
|
|
blocks that were previously missed; and b) greatly increase my
ohloh stats!
|
|
- Moved WIN32 code to ghost and added code for other systems.
- Added functions getClipboard(flag), and putClipboard(buffer, flag)
-Flag is used on X11 to request selection buffer or clipboard.
-If any other system uses flag = 1 the function returns doing nothing.
- Changed ctrl +c/v and shift+ctrl + c/v to do the same thing (use the clipboard).
- Changed the menu items (copy, paste) to use the clipboard.
|
|
previously only some datatypes adding functions accepted a name.
also updated the Bpy.py epydocs
|
|
Spaces or to tabs.
Adds function void convert_tabs(struct SpaceText *st, int tab)
int tab is eather 0 or 1; 1 if converting to tabs
I was going to make this auto run when running a script but did not know what that would do to the GE or any thing else.
|
|
contributed by Mr. TextEditor - themyers. Thanks!
|