undo

RichTextBox Undo Adding Spaces

感情迁移 提交于 2019-12-13 04:09:55
问题 I've created my own undo system for the RichTextBox whereby whenever you do something an undo action is added to a stack, and when you press undo, this action is undone. This behavior works perfectly with all controls I've implemented it for, except for RichTextBoxes. I have reduced the system down to its simplest elements, where whenever you press delete, it adds the current selected text and its index to a stack, and when you undo this, it puts the text back at this index. Here is the code

Javascript UndoManager Browser Support

三世轮回 提交于 2019-12-12 15:47:20
问题 The HTML5 spec mentions an UndoManager that can be used to query the previous state of a document that's been edited by a user ( http://www.whatwg.org/specs/web-apps/current-work/#undomanager ). Do any browsers support this? Is there any hope of browsers ever supporting it? 回答1: You can test your own browsers by navigating them to HTML5Test.com. You can also test for it on your page (and then use it if it exists) by doing the following: return typeof UndoManager !== 'undefined'; The browsers

Git checkout — recover lost files

点点圈 提交于 2019-12-12 03:37:06
问题 I accidentaly deleted local file changes on git repository. They were NOT commited or even pushed. What I did: git status (then files not staged for commit showed and I accidentaly removed whole folder called "smdr" by this comand): git checkout -- smdr Then files changes disappeared. How can I recover those files (birng everything back before that git checkout -- smdr comand)? 回答1: You can't with Git. The files were not committed so they are not in history. You just got the (inexistant)

How do I undo the most recent local commits in Git?

北战南征 提交于 2019-12-12 03:26:15
问题 I accidentally committed the wrong files to Git, but I haven't pushed the commit to the server yet. How can I undo those commits from the local repository? 回答1: Undo a commit and redo $ git commit -m "Something terribly misguided" # (1) $ git reset HEAD~ # (2) << edit files as necessary >> # (3) $ git add ... # (4) $ git commit -c ORIG_HEAD # (5) This is what you want to undo. This does nothing to your working tree (the state of your files on disk), but undoes the commit and leaves the

Firebase - right way to implement an undoable .update()?

核能气质少年 提交于 2019-12-12 01:28:59
问题 I'm just learning Firebase and noticed that any operation simply replaces the data, which is a bit different than what I've seen on couchDB. In my understanding of their documentation, for purposes of making a rollback/undo of an .update() operation possible, I would use the .push() method. The idea would be to keep 2 versions of the data, so that I can query for the previous object. TO boot, there would need to be a FILO kind of approach so I'm not storing more than 2 items. DATABASE BEFORE

Calling the builtin Undo functionality of EditText by sending Ctrl+Z

浪子不回头ぞ 提交于 2019-12-11 16:53:38
问题 I'm trying to execute the builtin Undo functionality of Android EditText (via TextView) by sending Ctrl+Z : public static KeyEvent keyEvent(int keycode, int metaState) { final long currentTime = System.currentTimeMillis(); return new KeyEvent(currentTime, currentTime, KeyEvent.ACTION_DOWN, keycode, 0, metaState); } mEditText.dispatchKeyEvent(keyEvent(KeyEvent.KEYCODE_Z, KeyEvent.META_CTRL_ON | KeyEvent.META_CTRL_LEFT_ON)); However, it does not work (doesn't do anything). If I connect a

Do not want the text to be centered

只谈情不闲聊 提交于 2019-12-11 11:16:29
问题 i've never programmed before or anything, but i have a college project in which i have to edit a layout. there's a part of it in which the text is kinda in center, when it reaches the center of the page it skippes to next line.. i want it to continue normally.. https://jsfiddle.net/nqpa6jh0/#&togetherjs=vORwosTiHV .image.feature2 { display: block; margin: 0 0 0em 0; } .image.feature2 img { display: block; width: 100%; border-radius: 50%; width: 200px; height: 200px; float: left } .image

How do I make undo/redo in <textarea> to react on 1 word at a time, word by word or character by character?

五迷三道 提交于 2019-12-11 05:52:18
问题 How do I make undo/redo in textarea to react on 1 word at a time, word by word or character by character? Not to all at once. Right now this function I have works but it reacts to all the words in the textarea at once and that is the wrong way to function in my case. I need it to react word by word and not all words at once, so that it works like a text editor. I am using Chrome, and I need it to work word by word or character by character for any web browser or at least for the major ones.

TFS : Discard un-checked merge changes

坚强是说给别人听的谎言 提交于 2019-12-11 05:21:45
问题 I tried to find answer for this but could not find. I am sorry if you feel it is duplicate. Please point me in correct direction. I did a merge from Main to Source . Due to some internal issues and build problems we decided to merge QA to Source . I did the following steps 1) Deleted my Source folder 2) Open Source Explorer via Team Explorer in VS 2012 and get latest code into my Source Code. 3) Open Source folder in Windows Explorer to see that I have all the code which I want. I open ALL